diff options
author | Raul Tambre <raul@tambre.ee> | 2020-12-04 15:46:07 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2020-12-08 16:43:59 (GMT) |
commit | 9f3c70a333f076aca61affff189232edaba89c38 (patch) | |
tree | 3a484b6802c039c2ec1922f95c5dee50d8fccd65 /Tests | |
parent | af7e1545c8219c6eebaff6272955e8cd99d175a5 (diff) | |
download | CMake-9f3c70a333f076aca61affff189232edaba89c38.zip CMake-9f3c70a333f076aca61affff189232edaba89c38.tar.gz CMake-9f3c70a333f076aca61affff189232edaba89c38.tar.bz2 |
CUDA, CXX, OBJCXX: C++23 support with Clang 12
Clang 12 landed initial support for C++23 language mode flag -std={c|gnu}++2b
in commit 6627a3c2873fdf7ccba1a1573371079be48b36e8.
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 |