https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120114
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tomasz Kaminski <tkami...@gcc.gnu.org>: https://gcc.gnu.org/g:52f6ab55051ff43fd1b40ff06d9501043f8ba844 commit r16-438-g52f6ab55051ff43fd1b40ff06d9501043f8ba844 Author: Tomasz KamiÅski <tkami...@redhat.com> Date: Mon May 5 16:32:58 2025 +0200 libstdc++: Fix width computation for the chrono formatting [PR120114] Use `__unicode::_field_width` to compute the field width of the output when writting the formatted output for std::chrono::types. This applies both to characters copied from format string, and one produced by localized formatting. We also use _Str_sink::view() instead of get(), which avoids copying the content of the buffer to std::string in case of small output. PR libstdc++/120114 libstdc++-v3/ChangeLog: * include/bits/chrono_io.h (__formatter_chrono::_M_format): Use __field_width. * testsuite/std/time/format/pr120114.cc: New test. Reviewed-by: Jonathan Wakely <jwak...@redhat.com> Signed-off-by: Tomasz KamiÅski <tkami...@redhat.com>