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.
This commit is contained in:
Haowei 2024-10-04 06:45:29 -07:00 committed by GitHub
parent e62c41ffb0
commit 22701d5f63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2662,7 +2662,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(str);
if (FMT_USE_CONSTEVAL)
detail::parse_format_string<char>(sv, checker(sv, arg_pack()));
#ifdef FMT_ENFORCE_COMPILE_STRING