Ver código fonte

Features: Add cxx_auto_function.

Stephen Kelly 11 anos atrás
pai
commit
0caf08e43e

+ 5 - 0
Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst

@@ -42,6 +42,11 @@ The features known to this version of CMake are:
 
   .. _N1720: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
 
+``cxx_trailing_return_types``
+  Automatic function return type, as defined in N2541_.
+
+  .. _N2541: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
+
 ``cxx_variadic_templates``
   Variadic templates, as defined in N2242_.
 

+ 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_trailing_return_types "${GNU44_CXX11}")
 set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}")
 # TODO: If features are ever recorded for GNU 4.3, there should possibly
 # be a new feature added like cxx_variadic_template_template_parameters,

+ 1 - 0
Source/cmMakefile.cxx

@@ -48,6 +48,7 @@
   F(cxx_final) \
   F(cxx_override) \
   F(cxx_static_assert) \
+  F(cxx_trailing_return_types) \
   F(cxx_variadic_templates)
 
 class cmMakefile::Internals

+ 5 - 0
Tests/CompileFeatures/cxx_trailing_return_types.cpp

@@ -0,0 +1,5 @@
+
+auto someFunc() -> int
+{
+  return 42;
+}