[Bug libstdc++/114863] std::format applying grouping to nan's and inf's

2024-04-30 Thread lcarreon at bigpond dot net.au via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114863

--- Comment #7 from Leo Carreon  ---
I'm assuming the fix is for all floating point types not just double.

[Bug libstdc++/114863] std::format applying grouping to nan's and inf's

2024-04-30 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114863

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #6 from Jonathan Wakely  ---
Fixed for 13.3 and 14.1, thanks for the report.

[Bug libstdc++/114863] std::format applying grouping to nan's and inf's

2024-04-30 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114863

--- Comment #5 from GCC Commits  ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
:

https://gcc.gnu.org/g:61c38a231d2df60cb6e914b3ecc73a0229c17ff6

commit r13-8665-g61c38a231d2df60cb6e914b3ecc73a0229c17ff6
Author: Jonathan Wakely 
Date:   Fri Apr 26 11:42:26 2024 +0100

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)

[Bug libstdc++/114863] std::format applying grouping to nan's and inf's

2024-04-30 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114863

--- Comment #4 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Jonathan Wakely
:

https://gcc.gnu.org/g:7a00c459cbb913ac165a39d344a48fc27800bb0a

commit r14-10154-g7a00c459cbb913ac165a39d344a48fc27800bb0a
Author: Jonathan Wakely 
Date:   Fri Apr 26 11:42:26 2024 +0100

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)

[Bug libstdc++/114863] std::format applying grouping to nan's and inf's

2024-04-26 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114863

--- Comment #3 from GCC Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:a0bc71e480132a528a4869c1cd7863f709768c53

commit r15-5-ga0bc71e480132a528a4869c1cd7863f709768c53
Author: Jonathan Wakely 
Date:   Fri Apr 26 11:42:26 2024 +0100

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.

[Bug libstdc++/114863] std::format applying grouping to nan's and inf's

2024-04-26 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114863

--- Comment #2 from Jonathan Wakely  ---
Maybe we could also make _M_localize more efficient for finite values by not
even attempting to use grouping for scientific format.

[Bug libstdc++/114863] std::format applying grouping to nan's and inf's

2024-04-26 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114863

--- Comment #1 from Jonathan Wakely  ---
--- 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())

[Bug libstdc++/114863] std::format applying grouping to nan's and inf's

2024-04-26 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114863

Jonathan Wakely  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
   Last reconfirmed||2024-04-26
 Status|UNCONFIRMED |ASSIGNED
   Target Milestone|--- |13.3