diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-04-06 08:17:15 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-08 09:05:57 (GMT) |
commit | 9a49fd21bedacdda51ecfa82a15a0e52dd64948f (patch) | |
tree | e96a14650a1088088c4f8c14e6249e785a58f926 | |
parent | 1889045ca672e295c18203401c27a9e62ff45424 (diff) | |
download | CMake-9a49fd21bedacdda51ecfa82a15a0e52dd64948f.zip CMake-9a49fd21bedacdda51ecfa82a15a0e52dd64948f.tar.gz CMake-9a49fd21bedacdda51ecfa82a15a0e52dd64948f.tar.bz2 |
Features: Add cxx_decltype_incomplete_return_types.
-rw-r--r-- | Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 5 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX-FeatureTests.cmake | 5 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 1 | ||||
-rw-r--r-- | Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp | 14 |
4 files changed, 23 insertions, 2 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index a16dced..437d000 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -42,6 +42,11 @@ The features known to this version of CMake are: .. _N2235: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf +``cxx_decltype_incomplete_return_types`` + Decltype on incomplete return types, as defined in N3276_. + + .. _N3276 : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf + ``cxx_decltype`` Decltype, as defined in N2343_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index a98ae3a..e93888c 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -3,8 +3,9 @@ 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(GNU481_CXX11 "((__GNUC__ * 100 + __GNUC_MINOR__) > 408 || __GNUC_PATCHLEVEL__ >= 1) && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${GNU481_CXX11}") +set(_cmake_feature_test_cxx_reference_qualified_functions "${GNU481_CXX11}") set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_alignas "${GNU48_CXX11}") set(_cmake_feature_test_cxx_alignof "${GNU48_CXX11}") diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 58c874d..8ae07b1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -49,6 +49,7 @@ F(cxx_auto_type) \ F(cxx_constexpr) \ F(cxx_decltype) \ + F(cxx_decltype_incomplete_return_types) \ F(cxx_defaulted_functions) \ F(cxx_delegating_constructors) \ F(cxx_deleted_functions) \ diff --git a/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp b/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp new file mode 100644 index 0000000..109d038 --- /dev/null +++ b/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp @@ -0,0 +1,14 @@ + +template<class T> +struct A +{ + ~A() = delete; +}; + +template<class T> auto h() -> A<T>; +template<class T> auto i(T) -> T; +template<class T> auto f(T) -> decltype(i(h<T>())); +template<class T> auto f(T) -> void; +auto g() -> void { + f(42); +} |