]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix format call in formatting with empty specs for durations.
authorTomasz Kamiński <tkaminsk@redhat.com>
Wed, 4 Jun 2025 09:05:11 +0000 (11:05 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Fri, 6 Jun 2025 11:25:02 +0000 (13:25 +0200)
This patches fixes an obvious error, where the output iterator argument was
missing for call to format_to, when duration with custom representation types
are used.

libstdc++-v3/ChangeLog:

* include/bits/chrono_io.h (__formatter_chrono:_M_s): Add missing
__out argument to format_to call.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
(cherry picked from commit ac0a04b7a254fb8e1d8d7088336bcb4375807b1e)

libstdc++-v3/include/bits/chrono_io.h

index 7ab989f59a1c7cec6a0617439d2d5572828c3bfe..32ef3533c720af74fc2a8cc48727feaea058295f 100644 (file)
@@ -1318,7 +1318,8 @@ namespace __format
                  else
                    {
                      auto __str = std::format(_S_empty_spec, __ss.count());
-                     __out = std::format_to(_GLIBCXX_WIDEN("{:0>{}s}"),
+                     __out = std::format_to(std::move(__out),
+                                            _GLIBCXX_WIDEN("{:0>{}s}"),
                                             __str,
                                             __hms.fractional_width);
                    }