https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116755
--- Comment #18 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:b349c651ff16240b8cc4225db76479154c941c28 commit r15-4203-gb349c651ff16240b8cc4225db76479154c941c28 Author: Jonathan Wakely <jwak...@redhat.com> Date: Wed Sep 18 17:20:29 2024 +0100 libstdc++: Fix formatting of chrono::duration with character rep [PR116755] Implement Peter Dimov's suggestion for resolving LWG 4118, which is to use +d.count() so that character types are promoted to an integer type before formatting them. This didn't have unanimous consensus in the committee as Howard Hinnant proposed that we should format the rep consistently with std::format("{}", d.count()) instead. That ends up being more complicated, because it makes std::formattable a precondition of operator<< which was not previously the case, and it means that ios_base::fmtflags from the stream would be ignored because std::format doesn't use them. libstdc++-v3/ChangeLog: PR libstdc++/116755 * include/bits/chrono_io.h (operator<<): Use +d.count() for duration inserter. (__formatter_chrono::_M_format): Likewise for %Q format. * testsuite/20_util/duration/io.cc: Test durations with character types as reps.