From 22701d5f63fd9ba3ffa35fe94585b5bfcb69238b Mon Sep 17 00:00:00 2001 From: Haowei Date: Fri, 4 Oct 2024 06:45:29 -0700 Subject: [PATCH] Address build failures when using Tip-of-Tree clang. (#4187) When using ToT clang to build fmtlib, it complains 'sv' is not initialized by a constant expression. This patch addresses this issue. --- include/fmt/base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 84b175c3..21444176 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -2662,7 +2662,7 @@ template struct fstring { template ::value)> FMT_CONSTEVAL FMT_ALWAYS_INLINE fstring(const S& s) : str(s) { - FMT_CONSTEXPR auto sv = string_view(S()); + auto sv = string_view(str); if (FMT_USE_CONSTEVAL) detail::parse_format_string(sv, checker(sv, arg_pack())); #ifdef FMT_ENFORCE_COMPILE_STRING