Features: Test presence of cxx_auto_type with genex.

The purpose of that test is to cover the case where the genex
reports '1', and the feature is chosen to be present on all/most
supported compilers.  GNU 4.4 does not support cxx_nullptr.
This commit is contained in:
Stephen Kelly 2015-01-17 15:58:45 +01:00
parent 7b9fc88b04
commit 782591350c
2 changed files with 6 additions and 13 deletions

View File

@ -194,7 +194,7 @@ if (CMAKE_CXX_COMPILE_FEATURES)
set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11)
target_compile_definitions(CompileFeaturesGenex PRIVATE target_compile_definitions(CompileFeaturesGenex PRIVATE
HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override> HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>
HAVE_NULLPTR=$<COMPILE_FEATURES:cxx_nullptr> HAVE_AUTO_TYPE=$<COMPILE_FEATURES:cxx_auto_type>
HAVE_INHERITING_CONSTRUCTORS=$<COMPILE_FEATURES:cxx_inheriting_constructors> HAVE_INHERITING_CONSTRUCTORS=$<COMPILE_FEATURES:cxx_inheriting_constructors>
HAVE_FINAL=$<COMPILE_FEATURES:cxx_final> HAVE_FINAL=$<COMPILE_FEATURES:cxx_final>
HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$<COMPILE_FEATURES:cxx_inheriting_constructors,cxx_final> HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$<COMPILE_FEATURES:cxx_inheriting_constructors,cxx_final>
@ -204,7 +204,7 @@ if (CMAKE_CXX_COMPILE_FEATURES)
target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert)
target_compile_definitions(CompileFeaturesGenex2 PRIVATE target_compile_definitions(CompileFeaturesGenex2 PRIVATE
HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override> HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>
HAVE_NULLPTR=$<COMPILE_FEATURES:cxx_nullptr> HAVE_AUTO_TYPE=$<COMPILE_FEATURES:cxx_auto_type>
HAVE_INHERITING_CONSTRUCTORS=$<COMPILE_FEATURES:cxx_inheriting_constructors> HAVE_INHERITING_CONSTRUCTORS=$<COMPILE_FEATURES:cxx_inheriting_constructors>
HAVE_FINAL=$<COMPILE_FEATURES:cxx_final> HAVE_FINAL=$<COMPILE_FEATURES:cxx_final>
HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$<COMPILE_FEATURES:cxx_inheriting_constructors,cxx_final> HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$<COMPILE_FEATURES:cxx_inheriting_constructors,cxx_final>
@ -216,7 +216,7 @@ if (CMAKE_CXX_COMPILE_FEATURES)
target_link_libraries(CompileFeaturesGenex3 PRIVATE static_assert_iface) target_link_libraries(CompileFeaturesGenex3 PRIVATE static_assert_iface)
target_compile_definitions(CompileFeaturesGenex3 PRIVATE target_compile_definitions(CompileFeaturesGenex3 PRIVATE
HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override> HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>
HAVE_NULLPTR=$<COMPILE_FEATURES:cxx_nullptr> HAVE_AUTO_TYPE=$<COMPILE_FEATURES:cxx_auto_type>
HAVE_INHERITING_CONSTRUCTORS=$<COMPILE_FEATURES:cxx_inheriting_constructors> HAVE_INHERITING_CONSTRUCTORS=$<COMPILE_FEATURES:cxx_inheriting_constructors>
HAVE_FINAL=$<COMPILE_FEATURES:cxx_final> HAVE_FINAL=$<COMPILE_FEATURES:cxx_final>
HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$<COMPILE_FEATURES:cxx_inheriting_constructors,cxx_final> HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$<COMPILE_FEATURES:cxx_inheriting_constructors,cxx_final>

View File

@ -17,9 +17,9 @@ struct B final : A
#endif #endif
#if !HAVE_NULLPTR #if !HAVE_AUTO_TYPE
#error "Expect nullptr feature" # error Expect cxx_auto_type support
#else #endif
#if !HAVE_INHERITING_CONSTRUCTORS #if !HAVE_INHERITING_CONSTRUCTORS
# if EXPECT_INHERITING_CONSTRUCTORS # if EXPECT_INHERITING_CONSTRUCTORS
@ -51,13 +51,6 @@ struct B final : A
# endif # endif
#endif #endif
const char* getString()
{
return nullptr;
}
#endif
int main() int main()
{ {