diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-04-04 12:52:48 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-08 09:05:56 (GMT) |
commit | e74b216c90d33548e7b248276346a5d00eff5ee3 (patch) | |
tree | 767aea3539e89e92f178375de785a04dbd7419e3 | |
parent | ff80c3b4201918c2f30241972d3553a99571eed8 (diff) | |
download | CMake-e74b216c90d33548e7b248276346a5d00eff5ee3.zip CMake-e74b216c90d33548e7b248276346a5d00eff5ee3.tar.gz CMake-e74b216c90d33548e7b248276346a5d00eff5ee3.tar.bz2 |
Features: Add cxx_generalized_initializers.
-rw-r--r-- | Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 5 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX-FeatureTests.cmake | 1 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 1 | ||||
-rw-r--r-- | Tests/CompileFeatures/cxx_generalized_initializers.cpp | 23 |
4 files changed, 30 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index 05fc1bd..9329968 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -77,6 +77,11 @@ The features known to this version of CMake are: .. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm +``cxx_generalized_initializers`` + Initializer lists, as defined in N2672_. + + .. _N2672: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm + ``cxx_inheriting_constructors`` Inheriting constructors, as defined in N2540_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index be3c27e..fcdffac 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -40,6 +40,7 @@ set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}") set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}") +set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}") set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}") set(_cmake_feature_test_cxx_trailing_return_types "${GNU44_CXX11}") set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}") diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 63c00cc..c1d276e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -55,6 +55,7 @@ F(cxx_explicit_conversions) \ F(cxx_extern_templates) \ F(cxx_final) \ + F(cxx_generalized_initializers) \ F(cxx_inheriting_constructors) \ F(cxx_lambdas) \ F(cxx_noexcept) \ diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp new file mode 100644 index 0000000..8013ef5 --- /dev/null +++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp @@ -0,0 +1,23 @@ + +// Dummy implementation. Test only the compiler feature. +namespace std { + typedef decltype(sizeof(int)) size_t; + template <class _E> + class initializer_list + { + const _E* __begin_; + size_t __size_; + + }; +} + +template <typename T> +struct A +{ + A(std::initializer_list<T>) {} +}; + +void someFunc() +{ + A<int> as = { 1, 2, 3, 4 }; +} |