Skip to content

Address build failures when using Tip-of-Tree clang.#4187

Merged
vitaut merged 1 commit intofmtlib:masterfrom
zeroomega:clang_fix
Oct 4, 2024
Merged

Address build failures when using Tip-of-Tree clang.#4187
vitaut merged 1 commit intofmtlib:masterfrom
zeroomega:clang_fix

Conversation

@zeroomega
Copy link
Copy Markdown
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
Copy Markdown
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!

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Looks like all CI build passed.

@vitaut vitaut merged commit 22701d5 into fmtlib:master Oct 4, 2024
@vitaut
Copy link
Copy Markdown
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