summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst5
-rw-r--r--Modules/Compiler/GNU-CXX-FeatureTests.cmake1
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Tests/CompileFeatures/cxx_default_function_template_args.cpp12
4 files changed, 19 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 710fdcf..1f9cbbd 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -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
+``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``
Defaulted functions, as defined in N2346_.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index be6fed4..94a31c8 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -60,6 +60,7 @@ set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}")
# TODO: Should be supported by GNU 4.3
set(GNU43_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
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_rvalue_references "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 61549ae..577aa37 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -50,6 +50,7 @@
F(cxx_constexpr) \
F(cxx_decltype) \
F(cxx_decltype_incomplete_return_types) \
+ F(cxx_default_function_template_args) \
F(cxx_defaulted_functions) \
F(cxx_delegating_constructors) \
F(cxx_deleted_functions) \
diff --git a/Tests/CompileFeatures/cxx_default_function_template_args.cpp b/Tests/CompileFeatures/cxx_default_function_template_args.cpp
new file mode 100644
index 0000000..3d14c52
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_default_function_template_args.cpp
@@ -0,0 +1,12 @@
+
+template<typename T = int>
+int someFunc()
+{
+ T t = 0;
+ return t;
+}
+
+void otherFunc()
+{
+ someFunc();
+}