summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-19 12:32:59 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-08 09:05:54 (GMT)
commit0685ac6edc8f9285e7b12d32a182e569a372856c (patch)
treef3f805a955f1388e51c3701ee661951c879583f4
parent57ac6a905c33211af420aaf1e7fc14b3871a7b16 (diff)
downloadCMake-0685ac6edc8f9285e7b12d32a182e569a372856c.zip
CMake-0685ac6edc8f9285e7b12d32a182e569a372856c.tar.gz
CMake-0685ac6edc8f9285e7b12d32a182e569a372856c.tar.bz2
Features: Add cxx_override.
-rw-r--r--Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst5
-rw-r--r--Modules/Compiler/GNU-CXX-FeatureTests.cmake1
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Tests/CompileFeatures/cxx_override.cpp7
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 a5ecf5a..073b0ca 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -32,6 +32,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_override``
+ Override control ``override`` 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 52f49b8..87ed765 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -6,6 +6,7 @@ set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408")
set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
+set(_cmake_feature_test_cxx_override "${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 a916141..8e4ba95 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -46,6 +46,7 @@
F(cxx_constexpr) \
F(cxx_delegating_constructors) \
F(cxx_final) \
+ F(cxx_override) \
F(cxx_static_assert) \
F(cxx_variadic_templates)
diff --git a/Tests/CompileFeatures/cxx_override.cpp b/Tests/CompileFeatures/cxx_override.cpp
new file mode 100644
index 0000000..55bec13
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_override.cpp
@@ -0,0 +1,7 @@
+
+struct A {
+ virtual void doNothing() {}
+};
+struct B : A {
+ void doNothing() override {}
+};