diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index ee383efe41..8924a00d93 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 c7de17b369..4539fd63d6 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 90187fd99f..c56627ff92 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 0000000000..96307dfc6a --- /dev/null +++ b/Tests/CompileFeatures/cxx_nullptr.cpp @@ -0,0 +1,10 @@ + +void someFunc(int*) +{ + +} + +void otherFunc() +{ + someFunc(nullptr); +}