-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fmt::format_to + FMT_STRING with char16_t/char32_t characters fails to compile #4198
Comments
Thanks for reporting but compile-time checks are only supported for |
We also hit this while upgrading from 10.2.1 to 11.x. We try pretty hard to use only char{8,16}_t in our data structures, avoiding things with unspecified/non-portable encoding like std::string and std::wstring, since we build in really interesting environments like winelib (where wchar_t might be libstdc++'s ucs-4, but there's still lots of windows
Interesting. I do see that even where it compiled in fmt 10.x the compile-time check was not actually performed. I.e. a totally incorrect usage like #include <fmt/format.h>
#include <fmt/xchar.h>
int main() {
(void)fmt::format(FMT_STRING(u8"hello {:x}"),u8"world");
} compiles just fine in fmt 10.2.x, but crashes at runtime with
whereas changing it to wchar_t detects the problem at compile time
Interestingly, these did work with So, just to make the change somewhat more searchable:
|
It's failing when using
char16_t
orchar32_t
with FMT_STRING infmt 11.x
, but it was working infmt 10.x
.Similar to #3925, PR #3931 only fixed
wchar_t
.godbolt repro:
https://godbolt.org/z/q4vqbTEc5
godbolt success for fmt 10.x:
https://godbolt.org/z/sT6aKjfjj
The text was updated successfully, but these errors were encountered: