2
0
mirror of https://github.com/boostorg/icl.git synced 2026-01-19 04:12:13 +00:00

Added compiler specific tests to look for compiler flaws on all available platforms.

[SVN r68588]
This commit is contained in:
Joachim Faulhaber
2011-01-31 21:13:17 +00:00
parent 7c84a90fbe
commit 682d2ea13a
5 changed files with 312 additions and 1 deletions

View File

@@ -63,5 +63,10 @@ test-suite "itl"
# Bug fixes --------------------------------------------------------------
[ run fix_include_after_thread_/fix_include_after_thread.cpp ]
[ run fix_icl_after_thread_/fix_icl_after_thread.cpp ]
[ run fix_icl_after_thread_/fix_icl_after_thread.cpp ]
# Check for compiler bugs ------------------------------------------------
# compile-fail-tests
[ run cmp_msvc_value_born_error_/cmp_msvc_value_born_error.cpp ]
[ run cmp_clang_ttp_passing_/cmp_clang_ttp_passing.cpp ]
;

View File

@@ -0,0 +1,45 @@
/*-----------------------------------------------------------------------------+
Copyright (c) 2011-2011: Joachim Faulhaber
+------------------------------------------------------------------------------+
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENCE.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
+-----------------------------------------------------------------------------*/
#define BOOST_TEST_MODULE icl::cmp_clang_ttp_passing unit test
#include <libs/icl/test/disable_test_warnings.hpp>
#include <boost/config.hpp>
#include "../unit_test_unwarned.hpp"
namespace sep
{
template<class T>class less{};
template
<
class T,
template<class>class less_T = sep::less
>
class cont{};
template
<
class T,
template<class T2,
template<class>class less_T2 = sep::less>class Cont
>
void func()
{
typedef Cont<T> cont_type;
}
}//namespace sep
BOOST_AUTO_TEST_CASE(dummy)
{
sep::func<int, sep::cont>();
BOOST_CHECK( true );
}

View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="vc9_cmp_clang_ttp_passing"
ProjectGUID="{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA2}"
RootNamespace="cmp_clang_ttp_passing"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../../../bin/debug/"
IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="../../../../bin/debug/$(ProjectName).exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
GenerateDebugInformation="true"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../../../../bin/release/"
IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="../../../../bin/release/$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\cmp_clang_ttp_passing.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\test_interval_map_shared.hpp"
>
</File>
<File
RelativePath="..\test_type_lists.hpp"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,39 @@
/*-----------------------------------------------------------------------------+
Copyright (c) 2011-2011: Joachim Faulhaber
+------------------------------------------------------------------------------+
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENCE.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
+-----------------------------------------------------------------------------*/
#define BOOST_TEST_MODULE icl::cmp_msvc_value_born_error unit test
#include <boost/config.hpp>
#include "../unit_test_unwarned.hpp"
namespace unhelpful{
// This declaration of a class template will cause
// the compilation of line 17 to fail with syntax error C2059
template<class T> class value{};
}
//--- affected code ---------------------------------------
template <class Type> struct meta_attribute
{
BOOST_STATIC_CONSTANT(int, value = 0);
};
template <class Type> struct meta_predicate
{
BOOST_STATIC_CONSTANT(bool, value =
( meta_attribute<Type>::value < 1)
//error C2059: syntax error : ')'
//IF class template value declared before
// ((meta_attribute<Type>::value) < 1) // Remedy#1 enclose into ()
// ( meta_attribute<Type>::value <=0) // Remedy#2 use operator <=
);
};
BOOST_AUTO_TEST_CASE(dummy)
{
BOOST_CHECK( meta_predicate<int>::value );
}

View File

@@ -57,6 +57,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_fix_include_after_threa
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_fix_icl_after_thread", "fix_icl_after_thread_\vc9_fix_icl_after_thread.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B8D9A9FA0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_cmp_msvc_value_born_error", "cmp_msvc_value_born_error_\vc9_cmp_msvc_value_born_error.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_cmp_clang_ttp_passing", "cmp_clang_ttp_passing_\vc9_cmp_clang_ttp_passing.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -175,6 +179,14 @@ Global
{EE61B7EF-EC45-4165-8B49-FD5B8D9A9FA0}.Debug|Win32.Build.0 = Debug|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D9A9FA0}.Release|Win32.ActiveCfg = Release|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D9A9FA0}.Release|Win32.Build.0 = Release|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA1}.Debug|Win32.ActiveCfg = Debug|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA1}.Debug|Win32.Build.0 = Debug|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA1}.Release|Win32.ActiveCfg = Release|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA1}.Release|Win32.Build.0 = Release|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA2}.Debug|Win32.ActiveCfg = Debug|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA2}.Debug|Win32.Build.0 = Debug|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA2}.Release|Win32.ActiveCfg = Release|Win32
{EE61B7EF-EC45-4165-8B49-FD5B8D7A9FA2}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE