[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-1954-g7bf0f2b
Stephen Kelly
steveire at gmail.com
Sun Apr 6 05:34:39 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 7bf0f2b264c52d3fe1fd6a7f7b5fbff549d7a636 (commit)
via bafca7a28516e17129346e485ebf9caf72563be5 (commit)
via d10b31d41288d516224d7e6b04c0262209cd3134 (commit)
via bb1db2d044654c545a82c222d72b733e92c0910e (commit)
via 1f22be4e8f5f3d6bd7713e7a4b3b7f4c300a67af (commit)
via 5da18c3bd6d46e25fcd40f79e5594a69b01f26c3 (commit)
via 2a55d7f0a57446bb3db4127ee9a048bdebb1fc4e (commit)
via 880f5d8f3ed3734265a8b216a831de48572357d2 (commit)
via d70fbbe5de3562ebc0eb4a1d7dcee81734e9621e (commit)
via 449a8f557dc7107a50249bea4dc2044210c840bb (commit)
via b9dec3c1f0e731103b71b9d2c89aa8a652d1d329 (commit)
via 2734a8431defb4d6ec37112fcbfbb2e196789de3 (commit)
via 92d1a1d3b7f185e1a4e3007abd751c98b2e16336 (commit)
via fe1a81511601543624ec9ace2547074a8a95a0a6 (commit)
via ea9de1afe625e1ca872a85e3a8f23969344bbe01 (commit)
via c526bdea98edc9745686f713a894f157994c41e2 (commit)
via dd92a2a5debc51c10f0753477640e5838d523bf2 (commit)
via 67856e3cf20ec0ff13941cacbb61bb993f8bd5ca (commit)
via d58ca38f4cd928c9d81b3c3878905f6b0fc94315 (commit)
via 0cbbb46ef7731abdb636f5c8996cb9a1058750a8 (commit)
from 966b57fbdeaf35998bf88fa9bfbb22f1d41716a0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7bf0f2b264c52d3fe1fd6a7f7b5fbff549d7a636
commit 7bf0f2b264c52d3fe1fd6a7f7b5fbff549d7a636
Merge: 966b57f bafca7a
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 05:34:37 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Apr 6 05:34:37 2014 -0400
Merge topic 'cxx11-features' into next
bafca7a2 Revert "Refactor the test a bit. Build only one target."
d10b31d4 Add note about rvalue references.
bb1db2d0 Add reference comment.
1f22be4e Features: Add cxx_long_long_type.
5da18c3b Fix reference for cxx_decltype.
2a55d7f0 Features: Add cxx_func_identifier.
880f5d8f Features: Add cxx_local_type_template_args.
d70fbbe5 Features: Add cxx_extended_friend_declarations.
449a8f55 Features: Add cxx_enum_forward_declarations.
b9dec3c1 Features: Add cxx_default_function_template_args.
2734a843 Allow variadic macros only in C++11 mode for now.
92d1a1d3 Fix extern templates version.
fe1a8151 Use a cxx_attributes test that does not produce a warning.
ea9de1af Features: Add cxx_right_angle_brackets.
c526bdea Features: Add cxx_decltype_incomplete_return_types.
dd92a2a5 Features: Add cxx_sizeof_member.
...
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bafca7a28516e17129346e485ebf9caf72563be5
commit bafca7a28516e17129346e485ebf9caf72563be5
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 11:32:58 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 11:33:08 2014 +0200
Revert "Refactor the test a bit. Build only one target."
This reverts commit 3784e268feb65e7bf85a0fc259da6c91a17ea182.
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index b542c17..e881918 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -3,21 +3,20 @@ cmake_minimum_required(VERSION 3.0)
project(CompileFeatures)
-foreach(feature ${CMAKE_CXX_KNOWN_FEATURES})
+macro(run_test feature)
if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ${feature})
- list(APPEND test_files ${feature}.cpp)
- list(APPEND test_features ${feature})
+ add_library(test_${feature} OBJECT ${feature}.cpp)
+ set_property(TARGET test_${feature}
+ PROPERTY COMPILE_FEATURES "${feature}"
+ )
else()
message("Not supported: ${feature}")
endif()
-endforeach()
+endmacro()
-if (test_files)
- add_library(test_features OBJECT ${test_files})
- set_property(TARGET test_features
- PROPERTY COMPILE_FEATURES "${test_features}"
- )
-endif()
+foreach(feature ${CMAKE_CXX_KNOWN_FEATURES})
+ run_test(${feature})
+endforeach()
add_executable(CompileFeatures main.cpp)
set_property(TARGET CompileFeatures
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d10b31d41288d516224d7e6b04c0262209cd3134
commit d10b31d41288d516224d7e6b04c0262209cd3134
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 11:22:49 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 11:23:06 2014 +0200
Add note about rvalue references.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 6b1ded0..39b77b2 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -34,6 +34,9 @@ set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}")
+# TODO:GCC documents support for rvalue references (2118) in GNU 4.3, but
+# support for Defining move special member functions (N3053) in GNU 4.6.
+# Is a separate feature needed for it? How should it be tested?
# TODO: Should be supported by GNU 4.5
set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb1db2d044654c545a82c222d72b733e92c0910e
commit bb1db2d044654c545a82c222d72b733e92c0910e
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 11:18:24 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 11:18:50 2014 +0200
Add reference comment.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 726c3e0..6b1ded0 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -1,4 +1,6 @@
+# Reference: http://gcc.gnu.org/projects/cxx0x.html
+
set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408")
# Introduced in GCC 4.8.1
set(GNU481_CXX11 "((__GNUC__ * 100 + __GNUC_MINOR__) > 408 || __GNUC_PATCHLEVEL__ >= 1) && __cplusplus >= 201103L")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f22be4e8f5f3d6bd7713e7a4b3b7f4c300a67af
commit 1f22be4e8f5f3d6bd7713e7a4b3b7f4c300a67af
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 11:14:42 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 11:14:42 2014 +0200
Features: Add cxx_long_long_type.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 909b5fb..ad599a3 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -225,3 +225,8 @@ The features known to this version of CMake are:
Predefined ``__func__`` identifier, as defined in N2340_.
.. _N2340: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
+
+``cxx_long_long_type``
+ ``long long`` type, as defined in N1811_.
+
+.. _N1811: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 731699b..726c3e0 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -65,6 +65,7 @@ set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}")
+set(_cmake_feature_test_cxx_long_long_type "${GNU43_CXX11}")
# TODO: Should be supported since GNU 3.4?
set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
# TODO: Should be supported forever?
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 26de3e7..31b074c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -84,7 +84,8 @@
F(cxx_enum_forward_declarations) \
F(cxx_extended_friend_declarations) \
F(cxx_local_type_template_args) \
- F(cxx_func_identifier)
+ F(cxx_func_identifier) \
+ F(cxx_long_long_type)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_long_long_type.cpp b/Tests/CompileFeatures/cxx_long_long_type.cpp
new file mode 100644
index 0000000..670324c
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_long_long_type.cpp
@@ -0,0 +1,5 @@
+
+void someFunc()
+{
+ long long ll = 9223372036854775807LL;
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5da18c3bd6d46e25fcd40f79e5594a69b01f26c3
commit 5da18c3bd6d46e25fcd40f79e5594a69b01f26c3
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:42:15 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:59:15 2014 +0200
Fix reference for cxx_decltype.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 0d1c916..909b5fb 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -58,9 +58,9 @@ The features known to this version of CMake are:
.. _N2347: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
``cxx_decltype``
- Decltype, as defined in N3276_.
+ Decltype, as defined in N2343_.
-.. _N3276: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf
+.. _N2343: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
``cxx_defaulted_functions``
Defaulted functions, as defined in N2346_.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2a55d7f0a57446bb3db4127ee9a048bdebb1fc4e
commit 2a55d7f0a57446bb3db4127ee9a048bdebb1fc4e
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:52:38 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:52:38 2014 +0200
Features: Add cxx_func_identifier.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 6564536..0d1c916 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -220,3 +220,8 @@ The features known to this version of CMake are:
Local and unnamed types as template arguments, as defined in N2657_.
.. _N2657: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
+
+``cxx_func_identifier``
+ Predefined ``__func__`` identifier, as defined in N2340_.
+
+.. _N2340: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 5270811..731699b 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -69,4 +69,5 @@ set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
# TODO: Should be supported forever?
set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_func_identifier "${_oldestSupported} && __cplusplus >= 201103L")
set(_oldestSupported)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8b49cd4..26de3e7 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -83,7 +83,8 @@
F(cxx_default_function_template_args) \
F(cxx_enum_forward_declarations) \
F(cxx_extended_friend_declarations) \
- F(cxx_local_type_template_args)
+ F(cxx_local_type_template_args) \
+ F(cxx_func_identifier)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_func_identifier.cpp b/Tests/CompileFeatures/cxx_func_identifier.cpp
new file mode 100644
index 0000000..d6166f8
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_func_identifier.cpp
@@ -0,0 +1,5 @@
+
+void someFunc()
+{
+ sizeof(__func__);
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=880f5d8f3ed3734265a8b216a831de48572357d2
commit 880f5d8f3ed3734265a8b216a831de48572357d2
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:38:50 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:41:04 2014 +0200
Features: Add cxx_local_type_template_args.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 13ed9b3..6564536 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -215,3 +215,8 @@ The features known to this version of CMake are:
Extended friend declarations, as defined in N1791_.
.. _N1791: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
+
+``cxx_local_type_template_args``
+ Local and unnamed types as template arguments, as defined in N2657_.
+
+.. _N2657: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 8bbf95e..5270811 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -37,6 +37,7 @@ set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}")
set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}")
+set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}")
# TODO: Should be supported by GNU 4.4
set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5117aae..8b49cd4 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -82,7 +82,8 @@
F(cxx_right_angle_brackets) \
F(cxx_default_function_template_args) \
F(cxx_enum_forward_declarations) \
- F(cxx_extended_friend_declarations)
+ F(cxx_extended_friend_declarations) \
+ F(cxx_local_type_template_args)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_local_type_template_args.cpp b/Tests/CompileFeatures/cxx_local_type_template_args.cpp
new file mode 100644
index 0000000..712e80c
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_local_type_template_args.cpp
@@ -0,0 +1,18 @@
+
+template <typename T>
+class X { };
+template <typename T>
+void f(T t) { }
+struct {} unnamed_obj;
+void f() {
+ struct A { };
+ enum { e1 };
+ typedef struct {} B;
+ B b;
+ X<A> x1;
+ X<A*> x2;
+ X<B> x3;
+ f(e1);
+ f(unnamed_obj);
+ f(b);
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d70fbbe5de3562ebc0eb4a1d7dcee81734e9621e
commit d70fbbe5de3562ebc0eb4a1d7dcee81734e9621e
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:37:52 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:41:04 2014 +0200
Features: Add cxx_extended_friend_declarations.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 8eb3237..13ed9b3 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -210,3 +210,8 @@ The features known to this version of CMake are:
Enum forward declarations, as defined in N2764_.
.. _N2764: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
+
+``cxx_extended_friend_declarations``
+ Extended friend declarations, as defined in N1791_.
+
+.. _N1791: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index ba5d5aa..8bbf95e 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -19,6 +19,7 @@ set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}")
+set(_cmake_feature_test_cxx_extended_friend_declarations "${GNU47_CXX11}")
# NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor
# release following that (March 2012), and the first minor release to
# support -std=c++11. Prior to that, support for C++11 features is technically
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 68f832b..5117aae 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -81,7 +81,8 @@
F(cxx_decltype_incomplete_return_types) \
F(cxx_right_angle_brackets) \
F(cxx_default_function_template_args) \
- F(cxx_enum_forward_declarations)
+ F(cxx_enum_forward_declarations) \
+ F(cxx_extended_friend_declarations)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp b/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp
new file mode 100644
index 0000000..631c699
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp
@@ -0,0 +1,25 @@
+
+template <typename T>
+struct B
+{
+ B() : m_i(42) {}
+private:
+ int m_i;
+ friend T;
+};
+
+struct A
+{
+ template<typename T>
+ int getBValue(B<T> b)
+ {
+ return b.m_i;
+ }
+};
+
+void someFunc()
+{
+ A a;
+ B<A> b;
+ a.getBValue(b);
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=449a8f557dc7107a50249bea4dc2044210c840bb
commit 449a8f557dc7107a50249bea4dc2044210c840bb
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:37:08 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:41:04 2014 +0200
Features: Add cxx_enum_forward_declarations.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index f3d4f98..8eb3237 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -205,3 +205,8 @@ The features known to this version of CMake are:
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_enum_forward_declarations``
+ Enum forward declarations, as defined in N2764_.
+
+.. _N2764: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 1888f66..ba5d5aa 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -30,6 +30,7 @@ set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}")
+set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}")
# TODO: Should be supported by GNU 4.5
set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index fddaf90..68f832b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -80,7 +80,8 @@
F(cxx_sizeof_member) \
F(cxx_decltype_incomplete_return_types) \
F(cxx_right_angle_brackets) \
- F(cxx_default_function_template_args)
+ F(cxx_default_function_template_args) \
+ F(cxx_enum_forward_declarations)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_enum_forward_declarations.cpp b/Tests/CompileFeatures/cxx_enum_forward_declarations.cpp
new file mode 100644
index 0000000..a7e1445
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_enum_forward_declarations.cpp
@@ -0,0 +1,8 @@
+
+enum SomeEnum : short;
+
+void someFunc()
+{
+ SomeEnum value;
+ int i = value;
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9dec3c1f0e731103b71b9d2c89aa8a652d1d329
commit b9dec3c1f0e731103b71b9d2c89aa8a652d1d329
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:41:01 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:41:01 2014 +0200
Features: Add cxx_default_function_template_args.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index f4014e8..f3d4f98 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -200,3 +200,8 @@ The features known to this version of CMake are:
``cxx_right_angle_brackets``
Right angle bracket parsing, as defined in N1757_.
.. _N1757: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
+
+``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
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index db7d17a..1888f66 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -61,6 +61,7 @@ set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}")
+set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}")
# TODO: Should be supported since GNU 3.4?
set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
# TODO: Should be supported forever?
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f04e484..fddaf90 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -79,7 +79,8 @@
F(cxx_thread_local) \
F(cxx_sizeof_member) \
F(cxx_decltype_incomplete_return_types) \
- F(cxx_right_angle_brackets)
+ F(cxx_right_angle_brackets) \
+ F(cxx_default_function_template_args)
class cmMakefile::Internals
{
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();
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2734a8431defb4d6ec37112fcbfbb2e196789de3
commit 2734a8431defb4d6ec37112fcbfbb2e196789de3
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:26:48 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:26:48 2014 +0200
Allow variadic macros only in C++11 mode for now.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 5eb3920..db7d17a 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -64,5 +64,5 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}")
# TODO: Should be supported since GNU 3.4?
set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
# TODO: Should be supported forever?
-set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported}")
+set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported} && __cplusplus >= 201103L")
set(_oldestSupported)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92d1a1d3b7f185e1a4e3007abd751c98b2e16336
commit 92d1a1d3b7f185e1a4e3007abd751c98b2e16336
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:26:16 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:26:16 2014 +0200
Fix extern templates version.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 2badc1e..5eb3920 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -44,7 +44,6 @@ set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}")
-set(_cmake_feature_test_cxx_extern_templates "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_inline_namespaces "${GNU44_CXX11}")
@@ -62,6 +61,8 @@ set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}")
+# TODO: Should be supported since GNU 3.4?
+set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
# TODO: Should be supported forever?
set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported}")
set(_oldestSupported)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe1a81511601543624ec9ace2547074a8a95a0a6
commit fe1a81511601543624ec9ace2547074a8a95a0a6
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:20:07 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:20:22 2014 +0200
Use a cxx_attributes test that does not produce a warning.
diff --git a/Tests/CompileFeatures/cxx_attributes.cpp b/Tests/CompileFeatures/cxx_attributes.cpp
index 2ff982b..a3c89ea 100644
--- a/Tests/CompileFeatures/cxx_attributes.cpp
+++ b/Tests/CompileFeatures/cxx_attributes.cpp
@@ -1,2 +1,2 @@
-void unusedFunc [[unused]] () { }
+void unusedFunc [[noreturn]] () { throw 1; }
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea9de1afe625e1ca872a85e3a8f23969344bbe01
commit ea9de1afe625e1ca872a85e3a8f23969344bbe01
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:17:20 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:18:37 2014 +0200
Features: Add cxx_right_angle_brackets.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 49c4cb7..f4014e8 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -196,3 +196,7 @@ The features known to this version of CMake are:
Decltype on incomplete return types, as defined in N3276_.
.. _N3276 : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf
+
+``cxx_right_angle_brackets``
+ Right angle bracket parsing, as defined in N1757_.
+.. _N1757: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index c77fd84..2badc1e 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -61,6 +61,7 @@ set(GNU43_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}")
+set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}")
# TODO: Should be supported forever?
set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported}")
set(_oldestSupported)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9c7c411..f04e484 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -78,7 +78,8 @@
F(cxx_inline_namespaces) \
F(cxx_thread_local) \
F(cxx_sizeof_member) \
- F(cxx_decltype_incomplete_return_types)
+ F(cxx_decltype_incomplete_return_types) \
+ F(cxx_right_angle_brackets)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_right_angle_brackets.cpp b/Tests/CompileFeatures/cxx_right_angle_brackets.cpp
new file mode 100644
index 0000000..0adbbba
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_right_angle_brackets.cpp
@@ -0,0 +1,11 @@
+
+template<typename T>
+struct A
+{
+ typedef T Result;
+};
+
+void someFunc()
+{
+ A<A<int>> object;
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c526bdea98edc9745686f713a894f157994c41e2
commit c526bdea98edc9745686f713a894f157994c41e2
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:17:15 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:18:12 2014 +0200
Features: Add cxx_decltype_incomplete_return_types.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 299f0a5..49c4cb7 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -191,3 +191,8 @@ The features known to this version of CMake are:
Size of non-static data members, as defined in N2253_.
.. _N2253: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
+
+``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
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 319a70e..c77fd84 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -1,8 +1,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_reference_qualified_functions "${GNU481_CXX11}")
+set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${GNU481_CXX11}")
set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
set(_cmake_feature_test_cxx_alignas "${GNU48_CXX11}")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e926f25..9c7c411 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -77,7 +77,8 @@
F(cxx_variadic_macros) \
F(cxx_inline_namespaces) \
F(cxx_thread_local) \
- F(cxx_sizeof_member)
+ F(cxx_sizeof_member) \
+ F(cxx_decltype_incomplete_return_types)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp b/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp
new file mode 100644
index 0000000..109d038
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp
@@ -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);
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd92a2a5debc51c10f0753477640e5838d523bf2
commit dd92a2a5debc51c10f0753477640e5838d523bf2
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:09:37 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:12:20 2014 +0200
Features: Add cxx_sizeof_member.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 2794105..299f0a5 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -186,3 +186,8 @@ The features known to this version of CMake are:
Thread-local variables, as defined in N2659_.
.. _N2659: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
+
+``cxx_sizeof_member``
+ Size of non-static data members, as defined in N2253_.
+
+.. _N2253: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 35d15a8..319a70e 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -47,6 +47,7 @@ set(_cmake_feature_test_cxx_extern_templates "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_inline_namespaces "${GNU44_CXX11}")
+set(_cmake_feature_test_cxx_sizeof_member "${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,
# which is implemented by GNU 4.4, but not 4.3. cxx_variadic_templates is
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 98f4399..e926f25 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -76,7 +76,8 @@
F(cxx_uniform_initialization) \
F(cxx_variadic_macros) \
F(cxx_inline_namespaces) \
- F(cxx_thread_local)
+ F(cxx_thread_local) \
+ F(cxx_sizeof_member)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_sizeof_member.cpp b/Tests/CompileFeatures/cxx_sizeof_member.cpp
new file mode 100644
index 0000000..ae143d2
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_sizeof_member.cpp
@@ -0,0 +1,10 @@
+
+struct A
+{
+ int m_i;
+};
+
+int someFunc()
+{
+ return sizeof(A::m_i) > 0 ? 1 : 2;
+}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=67856e3cf20ec0ff13941cacbb61bb993f8bd5ca
commit 67856e3cf20ec0ff13941cacbb61bb993f8bd5ca
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:10:54 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:10:54 2014 +0200
Features: Add cxx_thread_local.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 21089ab..2794105 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -181,3 +181,8 @@ The features known to this version of CMake are:
Inline namespaces, as defined in N2535_.
.. _N2535: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
+
+``thread_local``
+ Thread-local variables, as defined in N2659_.
+
+.. _N2659: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index a638f2b..35d15a8 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -8,6 +8,7 @@ set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
set(_cmake_feature_test_cxx_alignas "${GNU48_CXX11}")
set(_cmake_feature_test_cxx_alignof "${GNU48_CXX11}")
set(_cmake_feature_test_cxx_attributes "${GNU48_CXX11}")
+set(_cmake_feature_test_cxx_thread_local "${GNU48_CXX11}")
# TODO: Should be supported by GNU 4.7
set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 69e4e42..98f4399 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -75,7 +75,8 @@
F(cxx_generalized_initializers) \
F(cxx_uniform_initialization) \
F(cxx_variadic_macros) \
- F(cxx_inline_namespaces)
+ F(cxx_inline_namespaces) \
+ F(cxx_thread_local)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_thread_local.cpp b/Tests/CompileFeatures/cxx_thread_local.cpp
new file mode 100644
index 0000000..1fb27e2
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_thread_local.cpp
@@ -0,0 +1,2 @@
+
+thread_local unsigned int rage = 1;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d58ca38f4cd928c9d81b3c3878905f6b0fc94315
commit d58ca38f4cd928c9d81b3c3878905f6b0fc94315
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:07:26 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:07:26 2014 +0200
Features: Expect cxx_variadic_templates to implement N2555.
N2555 is essentially a bugfix and predates most compiler releases which
aimed to experimentally support variadic templates.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 611298f..a638f2b 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -17,6 +17,11 @@ set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}")
+# NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor
+# release following that (March 2012), and the first minor release to
+# support -std=c++11. Prior to that, support for C++11 features is technically
+# experiemental and possibly incomplete (see for example the note below about
+# cxx_variadic_template_template_parameters)
# TODO: Should be supported by GNU 4.6
set(GNU46_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
@@ -41,6 +46,13 @@ set(_cmake_feature_test_cxx_extern_templates "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_inline_namespaces "${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,
+# which is implemented by GNU 4.4, but not 4.3. cxx_variadic_templates is
+# actually implemented by GNU 4.3, but variadic template template parameters
+# 'completes' it, so that is the version we record as having the variadic
+# templates capability in CMake. See
+# http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
# TODO: Should be supported by GNU 4.3
set(GNU43_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp
index a4f87c0..1d5a706 100644
--- a/Tests/CompileFeatures/cxx_variadic_templates.cpp
+++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp
@@ -18,3 +18,48 @@ struct Interface
return I + Interface<Is...>::accumulate();
}
};
+
+// Note: split this into a separate test if a
+// cxx_variadic_template_template_parameters feature is added.
+
+template<typename T>
+struct eval {
+ enum {
+ Matched = 0
+ };
+};
+
+template<template<typename...> class T, typename... U>
+struct eval<T<U...> > {
+ enum {
+ Matched = 1
+ };
+};
+
+template<typename...>
+struct A {
+
+};
+template<typename T>
+struct B {
+
+};
+template<typename T, typename U>
+struct C {
+
+};
+template<typename T, typename U, typename...>
+struct D {
+
+};
+
+// Note: This test assumes that a compiler supporting this feature
+// supports static_assert. Add a workaround if that does not hold.
+static_assert(eval<A<> >::Matched, "A Matches");
+static_assert(eval<A<int> >::Matched, "A Matches");
+static_assert(eval<A<int, char> >::Matched, "A Matches");
+static_assert(eval<B<int> >::Matched, "B Matches");
+static_assert(eval<C<int, char> >::Matched, "C Matches");
+static_assert(eval<D<int, char> >::Matched, "D Matches");
+static_assert(eval<D<int, char, bool> >::Matched, "D Matches");
+static_assert(eval<D<int, char, bool, double> >::Matched, "D Matches");
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0cbbb46ef7731abdb636f5c8996cb9a1058750a8
commit 0cbbb46ef7731abdb636f5c8996cb9a1058750a8
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 10:07:19 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 10:07:19 2014 +0200
Features: Add cxx_inline_namespaces.
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index f70ed0f..21089ab 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -176,3 +176,8 @@ The features known to this version of CMake are:
Variadic macros, as defined in N1653_.
.. _N1653: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
+
+``cxx_inline_namespaces``
+ Inline namespaces, as defined in N2535_.
+
+.. _N2535: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 65e5750..611298f 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -40,6 +40,7 @@ set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_extern_templates "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}")
+set(_cmake_feature_test_cxx_inline_namespaces "${GNU44_CXX11}")
# TODO: Should be supported by GNU 4.3
set(GNU43_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 27f4c2e..69e4e42 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -74,7 +74,8 @@
F(cxx_attributes) \
F(cxx_generalized_initializers) \
F(cxx_uniform_initialization) \
- F(cxx_variadic_macros)
+ F(cxx_variadic_macros) \
+ F(cxx_inline_namespaces)
class cmMakefile::Internals
{
diff --git a/Tests/CompileFeatures/cxx_inline_namespaces.cpp b/Tests/CompileFeatures/cxx_inline_namespaces.cpp
new file mode 100644
index 0000000..59fa9c8
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_inline_namespaces.cpp
@@ -0,0 +1,26 @@
+namespace Lib
+{
+inline namespace Lib_1
+{
+ template <typename T> class A;
+}
+
+template <typename T> void g(T);
+}
+
+struct MyClass {
+
+};
+namespace Lib
+{
+template<>
+class A<MyClass> {
+
+};
+}
+
+void someFunc()
+{
+ Lib::A<MyClass> a;
+ g(a); // ok, Lib is an associated namespace of A
+}
-----------------------------------------------------------------------
Summary of changes:
Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 58 +++++++++++++++++++-
Modules/Compiler/GNU-CXX-FeatureTests.cmake | 37 +++++++++++--
Source/cmMakefile.cxx | 13 ++++-
Tests/CompileFeatures/CMakeLists.txt | 19 +++----
Tests/CompileFeatures/cxx_attributes.cpp | 2 +-
.../cxx_decltype_incomplete_return_types.cpp | 14 +++++
.../cxx_default_function_template_args.cpp | 12 ++++
.../cxx_enum_forward_declarations.cpp | 8 +++
.../cxx_extended_friend_declarations.cpp | 25 +++++++++
.../{cxx_auto_type.cpp => cxx_func_identifier.cpp} | 2 +-
Tests/CompileFeatures/cxx_inline_namespaces.cpp | 26 +++++++++
.../cxx_local_type_template_args.cpp | 18 ++++++
Tests/CompileFeatures/cxx_long_long_type.cpp | 5 ++
Tests/CompileFeatures/cxx_right_angle_brackets.cpp | 11 ++++
Tests/CompileFeatures/cxx_sizeof_member.cpp | 10 ++++
Tests/CompileFeatures/cxx_thread_local.cpp | 2 +
Tests/CompileFeatures/cxx_variadic_templates.cpp | 45 +++++++++++++++
17 files changed, 288 insertions(+), 19 deletions(-)
create mode 100644 Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp
create mode 100644 Tests/CompileFeatures/cxx_default_function_template_args.cpp
create mode 100644 Tests/CompileFeatures/cxx_enum_forward_declarations.cpp
create mode 100644 Tests/CompileFeatures/cxx_extended_friend_declarations.cpp
copy Tests/CompileFeatures/{cxx_auto_type.cpp => cxx_func_identifier.cpp} (51%)
create mode 100644 Tests/CompileFeatures/cxx_inline_namespaces.cpp
create mode 100644 Tests/CompileFeatures/cxx_local_type_template_args.cpp
create mode 100644 Tests/CompileFeatures/cxx_long_long_type.cpp
create mode 100644 Tests/CompileFeatures/cxx_right_angle_brackets.cpp
create mode 100644 Tests/CompileFeatures/cxx_sizeof_member.cpp
create mode 100644 Tests/CompileFeatures/cxx_thread_local.cpp
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list