Skip to content

Commit

Permalink
Address build failures when using Tip-of-Tree clang.
Browse files Browse the repository at this point in the history
When using ToT clang to build fmtlib, it complains 'sv' is not
initialized by a constant expression. This patch addresses this
issue.
  • Loading branch information
zeroomega committed Oct 2, 2024
1 parent c90bc91 commit a0de12c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -2667,7 +2667,7 @@ template <typename... T> struct fstring {
template <typename S,
FMT_ENABLE_IF(std::is_convertible<const S&, string_view>::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<char>(sv, checker(sv, arg_pack()));
#ifdef FMT_ENFORCE_COMPILE_STRING
Expand Down
2 changes: 1 addition & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a0de12c

Please sign in to comment.