summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2024-04-15 14:38:07 (GMT)
committerBrad King <brad.king@kitware.com>2024-04-16 19:34:57 (GMT)
commit2038f2c2b14b733a697d332fdaf357a1ea3167bb (patch)
tree9919f5bf3c306532fb95fdc9aca82d809dd2b32f /Tests/CompileFeatures
parentdcbc2ef00dadf3553464419bcff5bd6dc8b2ee62 (diff)
downloadCMake-2038f2c2b14b733a697d332fdaf357a1ea3167bb.zip
CMake-2038f2c2b14b733a697d332fdaf357a1ea3167bb.tar.gz
CMake-2038f2c2b14b733a697d332fdaf357a1ea3167bb.tar.bz2
C++26: Support detection as the default standard
This was missed in commit f808d8afb9 (CMake: Support upcoming C++26 language level, 2022-08-19, v3.25.0-rc1~218^2).
Diffstat (limited to 'Tests/CompileFeatures')
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt1
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index e206e70..d6acd7b 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -286,6 +286,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_CXX26=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},26>
DEFAULT_CXX23=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},23>
DEFAULT_CXX20=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},20>
DEFAULT_CXX17=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},17>
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
index c0cc1b6..b873b14 100644
--- a/Tests/CompileFeatures/default_dialect.cpp
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -3,7 +3,11 @@
template <long l>
struct Outputter;
-#if DEFAULT_CXX23
+#if DEFAULT_CXX26
+# if CXX_STD <= CXX_STD_23
+Outputter<CXX_STD> o;
+# endif
+#elif DEFAULT_CXX23
# if CXX_STD <= CXX_STD_20
Outputter<CXX_STD> o;
# endif