From 4d654c09e5471bbe398f266067cc9560c2f328be Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 24 Aug 2023 22:51:01 -0400 Subject: [PATCH] Don't expect the UDL definition for GCC < 4.9 The compile tests should expect the UDL to be there on GCC only for version 4.9 and above. --- test/compile-error-test/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/compile-error-test/CMakeLists.txt b/test/compile-error-test/CMakeLists.txt index c4a160688d4c..495f659859af 100644 --- a/test/compile-error-test/CMakeLists.txt +++ b/test/compile-error-test/CMakeLists.txt @@ -177,6 +177,12 @@ set(CMAKE_REQUIRED_FLAGS ) if (NOT SUPPORTS_USER_DEFINED_LITERALS) set (SUPPORTS_USER_DEFINED_LITERALS OFF) endif () +if (SUPPORTS_USER_DEFINED_LITERALS AND CMAKE_COMPILER_IS_GNUCXX) + # GCC before 4.9 is not supported for user-defined literals as it requires an + # invalid syntax in their definition. + set (SUPPORTS_USER_DEFINED_LITERALS + $,4.9.0>,OFF,ON> +endif() # Make sure that compiler features detected in the header # match the features detected in CMake.