Features: Add cxx_default_function_template_args.

This commit is contained in:
Stephen Kelly 2014-04-06 10:41:01 +02:00
parent 7b3e8a0534
commit adf22f611e
4 changed files with 19 additions and 0 deletions

View File

@ -52,6 +52,11 @@ The features known to this version of CMake are:
.. _N2343: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf .. _N2343: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
``cxx_default_function_template_args``
Default template arguments for function templates, as defined in DR226_
.. _DR226: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
``cxx_defaulted_functions`` ``cxx_defaulted_functions``
Defaulted functions, as defined in N2346_. Defaulted functions, as defined in N2346_.

View File

@ -60,6 +60,7 @@ set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}")
# TODO: Should be supported by GNU 4.3 # TODO: Should be supported by GNU 4.3
set(GNU43_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(GNU43_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}") set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}") set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}") set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}") set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")

View File

@ -50,6 +50,7 @@
F(cxx_constexpr) \ F(cxx_constexpr) \
F(cxx_decltype) \ F(cxx_decltype) \
F(cxx_decltype_incomplete_return_types) \ F(cxx_decltype_incomplete_return_types) \
F(cxx_default_function_template_args) \
F(cxx_defaulted_functions) \ F(cxx_defaulted_functions) \
F(cxx_delegating_constructors) \ F(cxx_delegating_constructors) \
F(cxx_deleted_functions) \ F(cxx_deleted_functions) \

View File

@ -0,0 +1,12 @@
template<typename T = int>
int someFunc()
{
T t = 0;
return t;
}
void otherFunc()
{
someFunc();
}