Browse Source

Features: Add cxx_func_identifier.

Stephen Kelly 11 years ago
parent
commit
dcaafada0e

+ 5 - 0
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
   .. _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``
 ``cxx_generalized_initializers``
   Initializer lists, as defined in N2672_.
   Initializer lists, as defined in N2672_.
 
 

+ 1 - 0
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?
 # TODO: Should be supported since GNU 3.4?
 set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
 set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
 # TODO: Should be supported forever?
 # 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(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported} && __cplusplus >= 201103L")
 set(_oldestSupported)
 set(_oldestSupported)

+ 1 - 0
Source/cmMakefile.cxx

@@ -59,6 +59,7 @@
   F(cxx_extended_friend_declarations) \
   F(cxx_extended_friend_declarations) \
   F(cxx_extern_templates) \
   F(cxx_extern_templates) \
   F(cxx_final) \
   F(cxx_final) \
+  F(cxx_func_identifier) \
   F(cxx_generalized_initializers) \
   F(cxx_generalized_initializers) \
   F(cxx_inheriting_constructors) \
   F(cxx_inheriting_constructors) \
   F(cxx_inline_namespaces) \
   F(cxx_inline_namespaces) \

+ 6 - 0
Tests/CompileFeatures/cxx_func_identifier.cpp

@@ -0,0 +1,6 @@
+
+void someFunc()
+{
+  bool b = sizeof(__func__);
+  (void)b;
+}