-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Compile error: partial specialization of struct fmt::v11::formatter #4303
Comments
Are you doing this as part of a unity/jumbo or something like that, is that how this scenario occurs? I believe this is falling foul of this rule, explained nicely by this SO answer:
Where here you're instantiating the specialization of the Also notably in a comment on that answer, clang silently happily compiles this while gcc doesn't, hence it only failing on gcc I'm not an expert on this, but as I see it, unless vitaut wants to provide support for this (possibly via a fmt_fwd type header(s) etc. and I don't know how hard that would be) I don't know of a solution for this, other than avoiding it @std-any-emplace |
This could probably happen if |
Yes, it did indeed happen during a unity build and it took me a while to figure out what was causing compile failure. My workaround for the issue was to include all aforementioned headers in all library-using files. |
What I also found interesting is, that the constness of |
Printing a
const std::filesystem::path
withfileystem
,fmt/ostream.h
andfmt/std.h
included and later includingfmt/ranges.h
in the same compilation unit causes a strange compile error.Tested with fmt-11.0.0 and gcc-14.2.
https://godbolt.org/z/G5TPbz7o9
The text was updated successfully, but these errors were encountered: