Browse Source

Features: Add cxx_defaulted_functions.

Stephen Kelly 11 years ago
parent
commit
91f3699000

+ 5 - 0
Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst

@@ -27,6 +27,11 @@ The features known to this version of CMake are:
 
   .. _N2343: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
 
+``cxx_defaulted_functions``
+  Defaulted functions, as defined in N2346_.
+
+  .. _N2346: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
+
 ``cxx_delegating_constructors``
   Delegating constructors, as defined in N1986_.
 

+ 1 - 0
Modules/Compiler/GNU-CXX-FeatureTests.cmake

@@ -18,6 +18,7 @@ set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
 # TODO: Should be supported by GNU 4.4
 set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
 set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")
+set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}")
 set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}")
 set(_cmake_feature_test_cxx_trailing_return_types "${GNU44_CXX11}")
 set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}")

+ 1 - 0
Source/cmMakefile.cxx

@@ -45,6 +45,7 @@
   F(cxx_auto_type) \
   F(cxx_constexpr) \
   F(cxx_decltype) \
+  F(cxx_defaulted_functions) \
   F(cxx_delegating_constructors) \
   F(cxx_final) \
   F(cxx_override) \

+ 9 - 0
Tests/CompileFeatures/cxx_defaulted_functions.cpp

@@ -0,0 +1,9 @@
+
+struct A {
+  A() = default;
+};
+
+void someFunc()
+{
+  A a;
+}