diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-04-26 11:42:26 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-04-30 09:36:44 +0100 |
commit | 7a00c459cbb913ac165a39d344a48fc27800bb0a (patch) | |
tree | cef9b11f54c8ab5debfc7995f9e97d3b4b734075 /libstdc++-v3/include | |
parent | e976bef1579086e6e83c6a47f6c5f8f996208f99 (diff) | |
download | gcc-7a00c459cbb913ac165a39d344a48fc27800bb0a.zip gcc-7a00c459cbb913ac165a39d344a48fc27800bb0a.tar.gz gcc-7a00c459cbb913ac165a39d344a48fc27800bb0a.tar.bz2 |
libstdc++: Do not apply localized formatting to NaN and inf [PR114863]
We don't want to add grouping to strings like "-inf", and there is no
radix character to replace either.
libstdc++-v3/ChangeLog:
PR libstdc++/114863
* include/std/format (__formatter_fp::format): Only use
_M_localized for finite values.
* testsuite/std/format/functions/format.cc: Check localized
formatting of NaN and initiny.
(cherry picked from commit 7501c0a397fcf609a1ff5f083746b6330b89ee11)
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/std/format | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 22dcb5f..48deba2 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -1734,7 +1734,7 @@ namespace __format } #endif - if (_M_spec._M_localized) + if (_M_spec._M_localized && __builtin_isfinite(__v)) { __wstr = _M_localize(__str, __expc, __fc.locale()); if (!__wstr.empty()) |