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.
This commit is contained in:
Dana Jansens 2023-08-24 22:51:01 -04:00 committed by GitHub
parent a35c30e844
commit 4d654c09e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
$<IF:$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,4.9.0>,OFF,ON>
endif()
# Make sure that compiler features detected in the header
# match the features detected in CMake.