From b2338ebf3e698589c69a521b4b4a7908dd959751 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tomasz=20Kami=C5=84ski?= Date: Wed, 4 Jun 2025 11:05:11 +0200 Subject: [PATCH] libstdc++: Fix format call in formatting with empty specs for durations. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Tomasz Kamiński (cherry picked from commit ac0a04b7a254fb8e1d8d7088336bcb4375807b1e) --- libstdc++-v3/include/bits/chrono_io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/chrono_io.h b/libstdc++-v3/include/bits/chrono_io.h index 7ab989f59a1..32ef3533c72 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); } -- 2.47.3