From a35c30e844913985237c8ca66c2bee75515a92fc Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 24 Aug 2023 22:13:57 -0400 Subject: [PATCH] Remove UDLs on GCC before 4.9 to simplify things GCC before 4.9 rejects the syntax that is now rejected on more modern compilers. --- include/fmt/format.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 9909e19f..acd65927 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -155,18 +155,12 @@ FMT_END_NAMESPACE // // GCC before 4.9 requires a space in `operator"" _a` which is invalid in later // compiler versions. -# if (FMT_HAS_FEATURE(cxx_user_literals) || FMT_GCC_VERSION >= 407 || \ +# if (FMT_HAS_FEATURE(cxx_user_literals) || FMT_GCC_VERSION >= 409 || \ FMT_MSC_VERSION >= 1900) && \ (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= /* UDL feature */ 480) # define FMT_USE_USER_DEFINED_LITERALS 1 -# if FMT_GCC_VERSION > 0 && FMT_GCC_VERSION < 409 -# define FMT_WHITESPACE_IN_USER_DEFINED_LITERALS 1 -# else -# define FMT_WHITESPACE_IN_USER_DEFINED_LITERALS 0 -# endif # else # define FMT_USE_USER_DEFINED_LITERALS 0 -# define FMT_WHITESPACE_IN_USER_DEFINED_LITERALS 0 # endif #endif @@ -4436,10 +4430,6 @@ template constexpr auto operator""_a() { using char_t = remove_cvref_t; return detail::udl_arg(); } -# elif FMT_WHITESPACE_IN_USER_DEFINED_LITERALS -constexpr auto operator"" _a(const char* s, size_t) -> detail::udl_arg { - return {s}; -} # else constexpr auto operator""_a(const char* s, size_t) -> detail::udl_arg { return {s};