]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix std::format thousands separators when sign present [PR120548]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 4 Jun 2025 17:22:28 +0000 (18:22 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 10 Jun 2025 14:06:55 +0000 (15:06 +0100)
commit974d59aec69b35bd4f7f8464a3bcfc55e849ed1f
tree5798a99a593cc6a8b5475246709c31fdf6c8bea7
parent615a92a1e6a90bcb012deb216cd141266b0954a0
libstdc++: Fix std::format thousands separators when sign present [PR120548]

The leading sign character should be skipped when deciding whether to
insert thousands separators into a floating-point format.

libstdc++-v3/ChangeLog:

PR libstdc++/120548
* include/std/format (__formatter_fp::_M_localize): Do not
include a leading sign character in the string to be grouped.
* testsuite/std/format/functions/format.cc: Check grouping when
sign is present in the output.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
(cherry picked from commit 2c3559839d70df6311da18fd93237050405580c3)
libstdc++-v3/include/std/format
libstdc++-v3/testsuite/std/format/functions/format.cc