-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address build failures when using Tip-of-Tree clang. #4187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
include/fmt/base.h
Outdated
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks correct but unfortunately this breaks a (somewhat limited) test that was supposed to catch multiple evaluations. Maybe we could fix it by using str
here which will ensure that conversion is done once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just revised it to use 'str'
Hope the CI will pass.
When using ToT clang to build fmtlib, it complains 'sv' is not initialized by a constant expression. This patch addresses this issue.
Looks like all CI build passed. |
Merged, thanks! |
Backport fmtlib#4187 to 11.0.2 See: fmtlib#4218
When using ToT clang to build fmtlib, it complains 'sv' is not initialized by a constant expression. This patch addresses this issue.