You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change fixes some errors generated by clang when building with modules, where it complained that with FMT_ATTACH_TO_GLOBAL_MODULE enabled the private module fragment definitions did not match their declarations.
MSVC did not reject the original code, however I've verified that MSVC is still happy after this change.
Sure. When compiling on clang 18 with -DFMT_MODULE -DFMT_ATTACH_TO_GLOBAL_MODULE, the following is generated (along with identical errors for many other symbols):
In file included from C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt\src\fmt.cc:131:
In file included from C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt\src\format.cc:8:
C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt/include\fmt/format-inl.h:32:15: error: declaration of 'assert_fail' in module fmt follows declaration in the global module
32 | FMT_FUNC void assert_fail(const char* file, int line, const char* message) {
| ^
C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt/include\fmt\base.h:394:27: note: previous declaration is here
394 | FMT_NORETURN FMT_API void assert_fail(const char* file, int line,
| ^
In file included from C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt\src\fmt.cc:131:
In file included from C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt\src\format.cc:8:
C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt/include\fmt/format-inl.h:41:15: error: declaration of 'format_error_code' in module fmt follows declaration in the global module
41 | FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code,
| ^
C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt/include\fmt\format.h:3863:14: note: previous declaration is here
3863 | FMT_API void format_error_code(buffer<char>& out, int error_code,
| ^
In file included from C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt\src\fmt.cc:131:
In file included from C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt\src\format.cc:8:
C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt/include\fmt/format-inl.h:64:15: error: declaration of 'report_error' in module fmt follows declaration in the global module
64 | FMT_FUNC void report_error(format_func func, int error_code,
| ^
C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt/include\fmt\format.h:3867:14: note: previous declaration is here
3867 | FMT_API void report_error(format_func func, int error_code,
| ^
Full command line for reference: C:/LLVM/build-18x/Release/bin/clang++ -DFMT_ATTACH_TO_GLOBAL_MODULE -DFMT_MODULE -IC:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt/include -IC:\Coding\Build2\third-party-packaging\build2-packaging\build\clang-release\fmt -IC:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt -std=c++2b -D__cpp_modules=201907L -Wno-unqualified-std-cast-call -fdiagnostics-color -fansi-escape-codes -finput-charset=UTF-8 -Xclang -fexternc-nounwind -D_MT -D_DLL -Xclang -fmodules-embed-all-files -fmodule-output=..\build\clang-release\fmt\fmt\src\fmt.lib.pcm -o ..\build\clang-release\fmt\fmt\src\fmt.lib.pcm.obj -c -x c++-module C:\Coding\Build2\third-party-packaging\build2-packaging\fmt\fmt\fmt\src\fmt.cc
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
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.
This change fixes some errors generated by clang when building with modules, where it complained that with
FMT_ATTACH_TO_GLOBAL_MODULEenabled the private module fragment definitions did not match their declarations.MSVC did not reject the original code, however I've verified that MSVC is still happy after this change.