avoid include locale inline if c++20 modules are enabled#4451
Merged
vitaut merged 1 commit intofmtlib:masterfrom May 22, 2025
Merged
avoid include locale inline if c++20 modules are enabled#4451vitaut merged 1 commit intofmtlib:masterfrom
vitaut merged 1 commit intofmtlib:masterfrom
Conversation
vitaut
requested changes
May 18, 2025
Contributor
vitaut
left a comment
There was a problem hiding this comment.
Please include the error in the PR summary and revert unrelated formatting changes.
b8afbf9 to
4057ea8
Compare
vitaut
reviewed
May 21, 2025
Comment on lines
-25
to
-27
| #if FMT_USE_LOCALE | ||
| # include <locale> | ||
| #endif |
Contributor
There was a problem hiding this comment.
I think the correct fix is to keep the include here but change the ifdef to
#if !defined(FMT_MODULE) && FMT_USE_LOCALE
MSVC hints with: ``` fmt\include\fmt\format-inl.h(26): warning C5244: '#include <locale>' in the purview of module 'fmt' appears erroneous. Consider moving that directive before the module declaration, or replace the textual inclusion with 'import <locale>;'. ``` Then fails the build with `type redefinition`.
4057ea8 to
082da8f
Compare
Contributor
|
Merged, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MSVC hints with:
Then fails the build with
type redefinition.See https://github.com/arBmind/fmtlib-module-experiment for a full example.