diff options
Diffstat (limited to 'Tests/CompileFeatures')
-rw-r--r-- | Tests/CompileFeatures/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CompileFeatures/default_dialect.cpp | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 200aa79..e94473f 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -295,6 +295,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_CXX20=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},20> DEFAULT_CXX17=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},17> DEFAULT_CXX14=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},14> DEFAULT_CXX11=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},11> @@ -449,6 +450,7 @@ else() HAVE_CXX_STD_11=$<COMPILE_FEATURES:cxx_std_11> 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> ) endif() diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp index 0de1125..7ddcfe7 100644 --- a/Tests/CompileFeatures/default_dialect.cpp +++ b/Tests/CompileFeatures/default_dialect.cpp @@ -8,7 +8,11 @@ struct Outputter; #define CXX_STD __cplusplus #endif -#if DEFAULT_CXX17 +#if DEFAULT_CXX20 +#if CXX_STD <= 201703L +Outputter<CXX_STD> o; +#endif +#elif DEFAULT_CXX17 #if CXX_STD <= 201402L Outputter<CXX_STD> o; #endif |