summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-02 14:00:00 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-04-02 14:01:23 (GMT)
commit1b6ec4b9e34a06c047cb41245587673959b5b591 (patch)
tree4945534c7f8b71ea81c4a9c708e2531d907e275c /Tests/CompileFeatures
parent5d5e1e691772ecfd9224be0afe33802f8aee3fc3 (diff)
parent8570dc7f64928ec7896197394f089f5ad063c6ca (diff)
downloadCMake-1b6ec4b9e34a06c047cb41245587673959b5b591.zip
CMake-1b6ec4b9e34a06c047cb41245587673959b5b591.tar.gz
CMake-1b6ec4b9e34a06c047cb41245587673959b5b591.tar.bz2
Merge topic 'features-c++20'
8570dc7f64 Help: Update compiler versions in cmake-compile-features.7.rst 874d3d2948 Help: Add release note for C++ 20 support 7f295b1bd3 Features: Activate C++ 20 support for Clang 5.0+ 71cb8ce3a1 Features: Activate C++ 20 support for GNU 8.0+ 8f146c4508 Features: Activate C++ 20 support for MSVC 19.12.25835+ 7fe580a362 Features: Add infrastructure for C++ 20 language standard 1b328e09a3 Features: Use -std=c++17 for C++ 17 on Clang 5.0+ 0bc3e5788a Features: Use -std=c++17 for C++ 17 on GNU 8.0+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1892
Diffstat (limited to 'Tests/CompileFeatures')
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt2
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp6
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