https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120114

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Tomasz Kaminski
<tkami...@gcc.gnu.org>:

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

commit r15-9631-ge52f71b6dd888f0d5548d9f5bd139601dbafb3be
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>
    (cherry picked from commit 52f6ab55051ff43fd1b40ff06d9501043f8ba844)

Reply via email to