summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-03 17:34:47 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-08 09:05:55 (GMT)
commit0fa9bbf1fa5278d965cbbb7de82f56ef42789fe8 (patch)
treeab8826f13ad1a7a1ed374b606b453927aa4d0645
parent8149fc909fb2c26235fea8999ea9396d7b45fba7 (diff)
downloadCMake-0fa9bbf1fa5278d965cbbb7de82f56ef42789fe8.zip
CMake-0fa9bbf1fa5278d965cbbb7de82f56ef42789fe8.tar.gz
CMake-0fa9bbf1fa5278d965cbbb7de82f56ef42789fe8.tar.bz2
Features: Add cxx_nullptr.
-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_nullptr.cpp10
4 files changed, 17 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index ee383ef..8924a00 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -72,6 +72,11 @@ The features known to this version of CMake are:
.. _N2756: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2756.htm
+``cxx_nullptr``
+ Null pointer, as defined in N2431_.
+
+ .. _N2431: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
+
``cxx_override``
Override control ``override`` keyword, as defined in N2928_.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index c7de17b..4539fd6 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -19,6 +19,7 @@ set(_cmake_feature_test_cxx_override "${GNU47_CXX11}")
# TODO: Should be supported by GNU 4.6
set(GNU46_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
+set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}")
# TODO: Should be supported by GNU 4.5
set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 90187fd..c56627f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -54,6 +54,7 @@
F(cxx_lambdas) \
F(cxx_noexcept) \
F(cxx_nonstatic_member_init) \
+ F(cxx_nullptr) \
F(cxx_override) \
F(cxx_static_assert) \
F(cxx_strong_enums) \
diff --git a/Tests/CompileFeatures/cxx_nullptr.cpp b/Tests/CompileFeatures/cxx_nullptr.cpp
new file mode 100644
index 0000000..96307df
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_nullptr.cpp
@@ -0,0 +1,10 @@
+
+void someFunc(int*)
+{
+
+}
+
+void otherFunc()
+{
+ someFunc(nullptr);
+}