diff options
-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_final.cpp | 2 |
4 files changed, 9 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index 042cd43..a5ecf5a 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -27,6 +27,11 @@ The features known to this version of CMake are: .. _N1986: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf +``cxx_final`` + Override control ``final`` keyword, as defined in N2928_. + + .. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm + ``cxx_static_assert`` Static assert, as defined in N1720_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 5d61656..52f49b8 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -5,6 +5,7 @@ set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408") # TODO: Should be supported by GNU 4.7 set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}") +set(_cmake_feature_test_cxx_final "${GNU47_CXX11}") # NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor # release following that (March 2012), and the first minor release to # support -std=c++11. Prior to that, support for C++11 features is technically diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fa806a7..a916141 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -45,6 +45,7 @@ F(cxx_auto_type) \ F(cxx_constexpr) \ F(cxx_delegating_constructors) \ + F(cxx_final) \ F(cxx_static_assert) \ F(cxx_variadic_templates) diff --git a/Tests/CompileFeatures/cxx_final.cpp b/Tests/CompileFeatures/cxx_final.cpp new file mode 100644 index 0000000..598cb94 --- /dev/null +++ b/Tests/CompileFeatures/cxx_final.cpp @@ -0,0 +1,2 @@ + +struct A final {}; |