From 350c40029ae033b58de588f060f85195bda12e65 Mon Sep 17 00:00:00 2001 From: Richard Musil Date: Sat, 1 Feb 2025 15:43:04 +0100 Subject: [PATCH] Drop C++ standard tests for compilers which do not implement required features. Signed-off-by: Richard Musil --- tests/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a153a69248..51342e51c4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,6 +21,11 @@ include(test) # override standard support ############################################################################# +# Clang only supports C++14 starting from Clang 3.5 (lesser versions miss std::enable_if_t) +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) + unset(compiler_supports_cpp_14) +endif() + # Clang only supports C++17 starting from Clang 5.0 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) unset(compiler_supports_cpp_17) @@ -29,6 +34,10 @@ endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.1) unset(compiler_supports_cpp_17) endif() +# GCC 5 and 6 do claim experimental support for C++17, but do not implement +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) + unset(compiler_supports_cpp_17) +endif() # Clang C++20 support appears insufficient prior to Clang 9.0 (based on CI build failure) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)