From 9f197b22ae2c809014e2a1b30c51ff1dc451508f Mon Sep 17 00:00:00 2001 From: friedkeenan Date: Sat, 22 Nov 2025 16:36:29 -0600 Subject: [PATCH] Make FMT_STRING redundant when FMT_USE_CONSTEVAL is enabled (#4612) --- include/fmt/format.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index e948c78e..039a7a37 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -4257,7 +4257,11 @@ class format_int { * // A compile-time error because 'd' is an invalid specifier for strings. * std::string s = fmt::format(FMT_STRING("{:d}"), "foo"); */ -#define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string) +#if FMT_USE_CONSTEVAL +# define FMT_STRING(s) s +#else +# define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string) +#endif // FMT_USE_CONSTEVAL FMT_API auto vsystem_error(int error_code, string_view fmt, format_args args) -> std::system_error;