Features: Add cxx_decltype_incomplete_return_types.

This commit is contained in:
Stephen Kelly 2014-04-06 10:17:15 +02:00
parent 1889045ca6
commit 9a49fd21be
4 changed files with 23 additions and 2 deletions

View File

@ -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_.

View File

@ -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}")

View File

@ -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) \

View File

@ -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);
}