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
Revealed by libc++ test std/utilities/format/format.functions/locale-specific_form.pass.cpp.
When neither precision nor type is specified, a floating-point value should be formatted as if by to_chars(first, last, value) ([format.string.std]). But MSVC STL uses to_chars(first, last, value, chars_format::general).
Command-line test case
D:\test>type test-format-2.cpp
#include <format>
#include <iostream>
int main() {
std::cout << std::format("{}\n", 12345678.0);
std::cout << std::format("{:}\n", 12345678.0);
}
D:\test>cl /std:c++20 /EHs /utf-8 test-format-2.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33321 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
test-format-2.cpp
Microsoft (R) Incremental Linker Version 14.39.33321.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test-format-2.exe
test-format-2.obj
D:\test>test-format-2
12345678
1.2345678e+07
Describe the bug
Revealed by libc++ test
std/utilities/format/format.functions/locale-specific_form.pass.cpp
.When neither precision nor type is specified, a floating-point value should be formatted as if by
to_chars(first, last, value)
([format.string.std]). But MSVC STL usesto_chars(first, last, value, chars_format::general)
.Command-line test case
Expected behavior
The second line should also be
12345678
.STL version
The text was updated successfully, but these errors were encountered: