summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-04 08:50:41 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-08 09:05:56 (GMT)
commite1e292cd069bf811b0635088539aace0f0eeaf68 (patch)
treee01d0fe9bfd01ee35f3bfcc1bfe2dfc62d994827
parent3300f783104b89c00bde1904e5528e9564c479a2 (diff)
downloadCMake-e1e292cd069bf811b0635088539aace0f0eeaf68.zip
CMake-e1e292cd069bf811b0635088539aace0f0eeaf68.tar.gz
CMake-e1e292cd069bf811b0635088539aace0f0eeaf68.tar.bz2
Features: Add cxx_alias_templates.
-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_alias_templates.cpp11
4 files changed, 18 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index bdcd46b..fbc45c2 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -12,6 +12,11 @@ command.
The features known to this version of CMake are:
+``cxx_alias_templates``
+ Template aliases, as defined in N2258_.
+
+ .. _N2258: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
+
``cxx_auto_type``
Automatic type deduction, as defined in N1984_.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 5bf3420..5f8d952 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -9,6 +9,7 @@ set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 2011
set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
# TODO: Should be supported by GNU 4.7
set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d632db6..fc89d8e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -42,6 +42,7 @@
#include <assert.h>
#define FOR_EACH_CXX_FEATURE(F) \
+ F(cxx_alias_templates) \
F(cxx_auto_type) \
F(cxx_constexpr) \
F(cxx_decltype) \
diff --git a/Tests/CompileFeatures/cxx_alias_templates.cpp b/Tests/CompileFeatures/cxx_alias_templates.cpp
new file mode 100644
index 0000000..a47e27d
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_alias_templates.cpp
@@ -0,0 +1,11 @@
+
+template <typename T1, typename T2>
+struct A
+{
+ typedef T1 MyT1;
+ using MyT2 = T2;
+};
+
+using B = A<int, char>;
+template<typename T>
+using C = A<int, T>;