summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-06 08:52:38 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-08 09:05:57 (GMT)
commitdcaafada0e213ae74082be84812a38d7f2a4a860 (patch)
treebf23a84aafb91097e7c6e31ae44fcc13d2223f7e
parent251a1f02a0ae7eb93690dd0daad8575a3c0451b3 (diff)
downloadCMake-dcaafada0e213ae74082be84812a38d7f2a4a860.zip
CMake-dcaafada0e213ae74082be84812a38d7f2a4a860.tar.gz
CMake-dcaafada0e213ae74082be84812a38d7f2a4a860.tar.bz2
Features: Add cxx_func_identifier.
-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_func_identifier.cpp6
4 files changed, 13 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 1a76a3b..32b47e4 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -97,6 +97,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_func_identifier``
+ Predefined ``__func__`` identifier, as defined in N2340_.
+
+ .. _N2340: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
+
``cxx_generalized_initializers``
Initializer lists, as defined in N2672_.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 586ab4b..d727cac 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -70,5 +70,6 @@ set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
# TODO: Should be supported since GNU 3.4?
set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
# TODO: Should be supported forever?
+set(_cmake_feature_test_cxx_func_identifier "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported} && __cplusplus >= 201103L")
set(_oldestSupported)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7b960a3..508ace5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -59,6 +59,7 @@
F(cxx_extended_friend_declarations) \
F(cxx_extern_templates) \
F(cxx_final) \
+ F(cxx_func_identifier) \
F(cxx_generalized_initializers) \
F(cxx_inheriting_constructors) \
F(cxx_inline_namespaces) \
diff --git a/Tests/CompileFeatures/cxx_func_identifier.cpp b/Tests/CompileFeatures/cxx_func_identifier.cpp
new file mode 100644
index 0000000..0c3595c
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_func_identifier.cpp
@@ -0,0 +1,6 @@
+
+void someFunc()
+{
+ bool b = sizeof(__func__);
+ (void)b;
+}