diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-04-02 22:02:54 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-08 09:05:54 (GMT) |
commit | 8d3467636c4fad32c25390244a62e58e068c33ad (patch) | |
tree | 9c4f9a1cefe548bd38fd72f3bfebdd5e3e97b8ee | |
parent | 0caf08e43ef405a879393cb3a4bae0b6b87e26b6 (diff) | |
download | CMake-8d3467636c4fad32c25390244a62e58e068c33ad.zip CMake-8d3467636c4fad32c25390244a62e58e068c33ad.tar.gz CMake-8d3467636c4fad32c25390244a62e58e068c33ad.tar.bz2 |
Features: Add cxx_strong_enums.
-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_strong_enums.cpp | 7 |
4 files changed, 14 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index 0d1329c..4a68573 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -42,6 +42,11 @@ The features known to this version of CMake are: .. _N1720: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html +``cxx_strong_enums`` + Strongly typed enums, as defined in N2347_. + + .. _N2347: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf + ``cxx_trailing_return_types`` Automatic function return type, as defined in N2541_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 3549824..c451b7e 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -18,6 +18,7 @@ set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") # TODO: Should be supported by GNU 4.4 set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_auto_type "${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_variadic_templates "${GNU44_CXX11}") # TODO: If features are ever recorded for GNU 4.3, there should possibly diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 3c23045..12d88e4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -48,6 +48,7 @@ F(cxx_final) \ F(cxx_override) \ F(cxx_static_assert) \ + F(cxx_strong_enums) \ F(cxx_trailing_return_types) \ F(cxx_variadic_templates) diff --git a/Tests/CompileFeatures/cxx_strong_enums.cpp b/Tests/CompileFeatures/cxx_strong_enums.cpp new file mode 100644 index 0000000..6262456 --- /dev/null +++ b/Tests/CompileFeatures/cxx_strong_enums.cpp @@ -0,0 +1,7 @@ + +enum class Colors +{ + RedColor, + GreenColor, + BlueColor +}; |