From daf560b1bd5719ab6346472fa130ba9b600dabe7 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 17 Sep 2023 22:49:24 -0400 Subject: [PATCH] Disable compile-error-test on GCC < 4.9 This avoids the UDL tests failing as GCC < 4.9 can not parse UDLs without a space, but the space is malformed in modern compilers. --- test/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6f614d13..ec97ac29 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -175,7 +175,12 @@ if (FMT_PEDANTIC) endif () # These tests are disabled on Windows because they take too long. -if (FMT_PEDANTIC AND NOT WIN32) +# They are disabled on GCC < 4.9 because it can not parse UDLs without +# a space after `operator""` but that is an incorrect syntax for any more +# modern compiler. +if (FMT_PEDANTIC AND NOT WIN32 AND NOT ( + CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)) # Test if incorrect API usages produce compilation error. add_test(compile-error-test ${CMAKE_CTEST_COMMAND} --build-and-test