diff options
author | Brad King <brad.king@kitware.com> | 2020-12-10 11:59:50 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-10 12:00:17 (GMT) |
commit | 9109475bfb9371e74c6ddbf64a66054e5aaea795 (patch) | |
tree | cca450d25b2a1c56be8348c4afca2cbc1183cd90 /Tests | |
parent | 0a2bb1871981735813a3ebcf7f6d5dfbe6727eff (diff) | |
parent | 9f3c70a333f076aca61affff189232edaba89c38 (diff) | |
download | CMake-9109475bfb9371e74c6ddbf64a66054e5aaea795.zip CMake-9109475bfb9371e74c6ddbf64a66054e5aaea795.tar.gz CMake-9109475bfb9371e74c6ddbf64a66054e5aaea795.tar.bz2 |
Merge topic 'cpp23'
9f3c70a333 CUDA, CXX, OBJCXX: C++23 support with Clang 12
af7e1545c8 CUDA, CXX: Remove HAS_FULL_SUPPORT for C++17 and 20
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5576
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CompileFeatures/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CompileFeatures/default_dialect.cpp | 6 | ||||
-rw-r--r-- | Tests/CompileFeatures/genex_test.cpp | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index ef9198d..0838532 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -268,6 +268,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) if (std_flag_idx EQUAL -1) add_executable(default_dialect default_dialect.cpp) target_compile_definitions(default_dialect PRIVATE + DEFAULT_CXX23=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},23> DEFAULT_CXX20=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},20> DEFAULT_CXX17=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},17> DEFAULT_CXX14=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},14> @@ -349,6 +350,7 @@ else() HAVE_CXX_STD_14=$<COMPILE_FEATURES:cxx_std_14> HAVE_CXX_STD_17=$<COMPILE_FEATURES:cxx_std_17> HAVE_CXX_STD_20=$<COMPILE_FEATURES:cxx_std_20> + HAVE_CXX_STD_23=$<COMPILE_FEATURES:cxx_std_23> ) endif() diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp index e6b3ff6..bd504ff 100644 --- a/Tests/CompileFeatures/default_dialect.cpp +++ b/Tests/CompileFeatures/default_dialect.cpp @@ -18,7 +18,11 @@ struct Outputter; # define CXX_STD __cplusplus #endif -#if DEFAULT_CXX20 +#if DEFAULT_CXX23 +# if CXX_STD <= 202002L +Outputter<CXX_STD> o; +# endif +#elif DEFAULT_CXX20 # if CXX_STD <= 201703L Outputter<CXX_STD> o; # endif diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 53dce62..9c3910e 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -21,6 +21,12 @@ # if HAVE_CXX_STD_17 && !defined(ALLOW_LATER_STANDARDS) # error HAVE_CXX_STD_17 is true with CXX_STANDARD == 11 # endif +# if HAVE_CXX_STD_20 && !defined(ALLOW_LATER_STANDARDS) +# error HAVE_CXX_STD_20 is true with CXX_STANDARD == 11 +# endif +# if HAVE_CXX_STD_23 && !defined(ALLOW_LATER_STANDARDS) +# error HAVE_CXX_STD_23 is true with CXX_STANDARD == 11 +# endif #endif #if !HAVE_OVERRIDE_CONTROL |