-
Notifications
You must be signed in to change notification settings - Fork 1.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
<format>: Wide and multibyte versions different behavior for char arg. #2320
Comments
This is by design, but it seems like a defect to me. Per [format.arg]/5, initializing a I _think _ the fix is to use a different storage type that is properly value-preserving regardless of the signed-ness of |
* `format(L"{}", c)` for a `char` `c` renders the single wide character `wchar_t{c}` when it should instead format `c` as an integer. * `format(L"{:d}", c)` for a `char` `c` formats `65536 + c` instead of `c` when `c < 0`. This seems to be a defect in the Standard for platforms with signed `char`. Fixes microsoft#2320
The wording is here, but for me this is definitely wrong, blindly convert from signed to unsigned type. Update: |
Is there any news on the subject, or where to track it? |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Oh, I found that it was a mistake. In P2909R2 the stored value is changed to |
The output:
Shouldn't the result be the same?
VS 16.11.5
Unfortunately I can't test in VS 17 at the moment.
The text was updated successfully, but these errors were encountered: