If one passes a fixed size char - array containing a 0-terminated string to std::format, the entire array minus one character is added to the result, instead of just the part until the null terminator. This not only seemingly violates [format.formatter.spec]/2.2, but also doesn't match the behavior of MS-STL or libstdc++. (And only formatting 49 characters out of a 50 character array seems buggy anyway.)
The issue is reproducible with all versions of libc++ that shipped with clang since <format> was added, including current trunk on godbolt.
Reproducer
If one passes a fixed size
char
- array containing a 0-terminated string tostd::format
, the entire array minus one character is added to the result, instead of just the part until the null terminator. This not only seemingly violates [format.formatter.spec]/2.2, but also doesn't match the behavior of MS-STL or libstdc++. (And only formatting 49 characters out of a 50 character array seems buggy anyway.)The issue is reproducible with all versions of libc++ that shipped with clang since
<format>
was added, including current trunk on godbolt.