From a0de12c97128a61ea32fb326b2db75a350c728e3 Mon Sep 17 00:00:00 2001 From: Haowei Wu Date: Wed, 2 Oct 2024 15:29:15 -0700 Subject: [PATCH] Address build failures when using Tip-of-Tree clang. 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 +- include/fmt/format.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index f91f8e8253548..ebb8fdf84a736 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -2667,7 +2667,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(s); if (FMT_USE_CONSTEVAL) detail::parse_format_string(sv, checker(sv, arg_pack())); #ifdef FMT_ENFORCE_COMPILE_STRING diff --git a/include/fmt/format.h b/include/fmt/format.h index 4ad1effd5132c..52af87b8b146f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2674,7 +2674,7 @@ class bigint { FMT_CONSTEXPR auto get_bigit(int i) const -> bigit { return i >= exp_ && i < num_bigits() ? bigits_[i - exp_] : 0; - }; + } FMT_CONSTEXPR void subtract_bigits(int index, bigit other, bigit& borrow) { auto result = double_bigit(bigits_[index]) - other - borrow;