aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Kamiński <tkaminsk@redhat.com>2025-06-04 11:05:11 +0200
committerTomasz Kamiński <tkaminsk@redhat.com>2025-06-06 13:25:02 +0200
commitb2338ebf3e698589c69a521b4b4a7908dd959751 (patch)
treea7ff1e36402ba26e27ab05cef3d4a048e61f9561
parent8cb0127dfd3d01d4549f3139b087d1a5966844ee (diff)
downloadgcc-b2338ebf3e698589c69a521b4b4a7908dd959751.zip
gcc-b2338ebf3e698589c69a521b4b4a7908dd959751.tar.gz
gcc-b2338ebf3e698589c69a521b4b4a7908dd959751.tar.bz2
libstdc++: Fix format call in formatting with empty specs for durations.
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)
-rw-r--r--libstdc++-v3/include/bits/chrono_io.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/chrono_io.h b/libstdc++-v3/include/bits/chrono_io.h
index 7ab989f..32ef353 100644
--- a/libstdc++-v3/include/bits/chrono_io.h
+++ b/libstdc++-v3/include/bits/chrono_io.h
@@ -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);
}