summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst5
-rw-r--r--Modules/Compiler/GNU-CXX-FeatureTests.cmake3
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Tests/CompileFeatures/cxx_reference_qualified_functions.cpp11
4 files changed, 20 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index e482fe3..13ead96 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -92,6 +92,11 @@ The features known to this version of CMake are:
.. _N2442: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
+``cxx_reference_qualified_functions``
+ Reference qualified functions, as defined in N2439_.
+
+ .. _N2439: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm
+
``cxx_static_assert``
Static assert, as defined in N1720_.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 5c1f2c8..b9ed092 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -2,6 +2,9 @@
# Reference: http://gcc.gnu.org/projects/cxx0x.html
set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408")
+# Introduced in GCC 4.8.1
+set(_cmake_feature_test_cxx_reference_qualified_functions
+ "((__GNUC__ * 100 + __GNUC_MINOR__) > 408 || __GNUC_PATCHLEVEL__ >= 1) && __cplusplus >= 201103L")
set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
# TODO: Should be supported by GNU 4.7
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2a10f1e..0cca2d6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -58,6 +58,7 @@
F(cxx_override) \
F(cxx_range_for) \
F(cxx_raw_string_literals) \
+ F(cxx_reference_qualified_functions) \
F(cxx_static_assert) \
F(cxx_strong_enums) \
F(cxx_trailing_return_types) \
diff --git a/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp b/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp
new file mode 100644
index 0000000..83a2361
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp
@@ -0,0 +1,11 @@
+
+struct test{
+ void f() & { }
+ void f() && { }
+};
+
+void someFunc(){
+ test t;
+ t.f(); // lvalue
+ test().f(); // rvalue
+}