Skip to content
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

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

zeroomega
Copy link
Contributor

When using ToT clang to build fmtlib, it complains 'sv' is not initialized by a constant expression. This patch addresses this issue.

Copy link
Contributor

@vitaut vitaut left a 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!

@@ -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);
Copy link
Contributor

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?

Copy link
Contributor Author

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.
@zeroomega
Copy link
Contributor Author

Looks like all CI build passed.

@vitaut vitaut merged commit 22701d5 into fmtlib:master Oct 4, 2024
45 checks passed
@vitaut
Copy link
Contributor

vitaut commented Oct 4, 2024

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants