summaryrefslogtreecommitdiffstats
path: root/Utilities/cmjsoncpp
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmjsoncpp')
0 files changed, 0 insertions, 0 deletions
at, 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.4 set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_auto_type "${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, +# 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 set(_oldestSupported) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index de6b972..52f4fb6 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -43,7 +43,8 @@ #define FOR_EACH_CXX_FEATURE(F) \ F(cxx_auto_type) \ - F(cxx_delegating_constructors) + F(cxx_delegating_constructors) \ + F(cxx_variadic_templates) class cmMakefile::Internals { diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp new file mode 100644 index 0000000..1d5a706 --- /dev/null +++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp @@ -0,0 +1,65 @@ +template +struct Interface; + +template +struct Interface +{ + static int accumulate() + { + return I; + } +}; + +template +struct Interface +{ + static int accumulate() + { + return I + Interface::accumulate(); + } +}; + +// Note: split this into a separate test if a +// cxx_variadic_template_template_parameters feature is added. + +template +struct eval { + enum { + Matched = 0 + }; +}; + +template class T, typename... U> +struct eval > { + enum { + Matched = 1 + }; +}; + +template +struct A { + +}; +template +struct B { + +}; +template +struct C { + +}; +template +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 >::Matched, "A Matches"); +static_assert(eval >::Matched, "A Matches"); +static_assert(eval >::Matched, "A Matches"); +static_assert(eval >::Matched, "B Matches"); +static_assert(eval >::Matched, "C Matches"); +static_assert(eval >::Matched, "D Matches"); +static_assert(eval >::Matched, "D Matches"); +static_assert(eval >::Matched, "D Matches"); -- cgit v0.12 From 91289312fa9da0807b5c59a78de2c5ad21d6cda1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 18 Mar 2014 12:53:01 +0100 Subject: Features: Add cxx_constexpr. --- Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 5 +++++ Modules/Compiler/GNU-CXX-FeatureTests.cmake | 3 +++ Source/cmMakefile.cxx | 1 + Tests/CompileFeatures/cxx_constexpr.cpp | 5 +++++ 4 files changed, 14 insertions(+) create mode 100644 Tests/CompileFeatures/cxx_constexpr.cpp diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index b6b2b35..aa314cd 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -17,6 +17,11 @@ The features known to this version of CMake are: .. _N1984: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf +``cxx_constexpr`` + Constant expressions, as defined in N2235_. + + .. _N2235: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf + ``cxx_delegating_constructors`` Delegating constructors, as defined in N1986_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 6baa463..5321eda 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -10,6 +10,9 @@ set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}") # 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}") # TODO: Should be supported by GNU 4.4 set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 52f4fb6..cc1dfa1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -43,6 +43,7 @@ #define FOR_EACH_CXX_FEATURE(F) \ F(cxx_auto_type) \ + F(cxx_constexpr) \ F(cxx_delegating_constructors) \ F(cxx_variadic_templates) diff --git a/Tests/CompileFeatures/cxx_constexpr.cpp b/Tests/CompileFeatures/cxx_constexpr.cpp new file mode 100644 index 0000000..570c10f --- /dev/null +++ b/Tests/CompileFeatures/cxx_constexpr.cpp @@ -0,0 +1,5 @@ + +constexpr int getNum() +{ + return 42; +} -- cgit v0.12 From 88542a61011d13ed0a92b9a1da49d428846aaf20 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 4 Apr 2014 00:00:28 +0200 Subject: Features: Add cxx_static_assert. --- Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 5 +++++ Modules/Compiler/GNU-CXX-FeatureTests.cmake | 3 +++ Source/cmMakefile.cxx | 1 + Tests/CompileFeatures/cxx_static_assert.cpp | 2 ++ 4 files changed, 11 insertions(+) create mode 100644 Tests/CompileFeatures/cxx_static_assert.cpp diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index aa314cd..042cd43 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -27,6 +27,11 @@ The features known to this version of CMake are: .. _N1986: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf +``cxx_static_assert`` + Static assert, as defined in N1720_. + + .. _N1720: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html + ``cxx_variadic_templates`` Variadic templates, as defined in N2242_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 5321eda..5d61656 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -24,4 +24,7 @@ set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}") # '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}") set(_oldestSupported) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index cc1dfa1..fa806a7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -45,6 +45,7 @@ F(cxx_auto_type) \ F(cxx_constexpr) \ F(cxx_delegating_constructors) \ + F(cxx_static_assert) \ F(cxx_variadic_templates) class cmMakefile::Internals diff --git a/Tests/CompileFeatures/cxx_static_assert.cpp b/Tests/CompileFeatures/cxx_static_assert.cpp new file mode 100644 index 0000000..6aa8678 --- /dev/null +++ b/Tests/CompileFeatures/cxx_static_assert.cpp @@ -0,0 +1,2 @@ + +static_assert(true, "static_assert test"); -- cgit v0.12 From 57ac6a905c33211af420aaf1e7fc14b3871a7b16 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 18 Mar 2014 23:42:05 +0100 Subject: Features: Add cxx_final. --- Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 5 +++++ Modules/Compiler/GNU-CXX-FeatureTests.cmake | 1 + Source/cmMakefile.cxx | 1 + Tests/CompileFeatures/cxx_final.cpp | 2 ++ 4 files changed, 9 insertions(+) create mode 100644 Tests/CompileFeatures/cxx_final.cpp diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index 042cd43..a5ecf5a 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -27,6 +27,11 @@ The features known to this version of CMake are: .. _N1986: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf +``cxx_final`` + Override control ``final`` keyword, as defined in N2928_. + + .. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm + ``cxx_static_assert`` Static assert, as defined in N1720_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 5d61656..52f49b8 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -5,6 +5,7 @@ set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408") # TODO: Should be supported by GNU 4.7 set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}") +set(_cmake_feature_test_cxx_final "${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 fa806a7..a916141 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -45,6 +45,7 @@ F(cxx_auto_type) \ F(cxx_constexpr) \ F(cxx_delegating_constructors) \ + F(cxx_final) \ F(cxx_static_assert) \ F(cxx_variadic_templates) diff --git a/Tests/CompileFeatures/cxx_final.cpp b/Tests/CompileFeatures/cxx_final.cpp new file mode 100644 index 0000000..598cb94 --- /dev/null +++ b/Tests/CompileFeatures/cxx_final.cpp @@ -0,0 +1,2 @@ + +struct A final {}; -- cgit v0.12 From 0685ac6edc8f9285e7b12d32a182e569a372856c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 19 Mar 2014 13:32:59 +0100 Subject: Features: Add cxx_override. --- Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 5 +++++ Modules/Compiler/GNU-CXX-FeatureTests.cmake | 1 + Source/cmMakefile.cxx | 1 + Tests/CompileFeatures/cxx_override.cpp | 7 +++++++ 4 files changed, 14 insertions(+) create mode 100644 Tests/CompileFeatures/cxx_override.cpp diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index a5ecf5a..073b0ca 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -32,6 +32,11 @@ The features known to this version of CMake are: .. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm +``cxx_override`` + Override control ``override`` keyword, as defined in N2928_. + + .. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm + ``cxx_static_assert`` Static assert, as defined in N1720_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 52f49b8..87ed765 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -6,6 +6,7 @@ set(_oldestSupported "(__GNUC__ * 100 + __