]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix format call and test formatting with empty specs for durations.
authorTomasz Kamiński <tkaminsk@redhat.com>
Wed, 4 Jun 2025 09:05:11 +0000 (11:05 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Wed, 4 Jun 2025 10:59:07 +0000 (12:59 +0200)
commitac0a04b7a254fb8e1d8d7088336bcb4375807b1e
tree6c5682c50d2000ad2f7ad4ba7e7b10b68488859c
parenta8b38447efe2c74094b865e1cc44723659dac2e4
libstdc++: Fix format call and test 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.

It's also adding the test for behavior of ostream operator and the formatting
with empty chron-spec for the chrono types. Current coverage is:
 * duration and hh_mm_ss in this commit,
 * calendar types in r16-1016-g28a17985dd34b7.

libstdc++-v3/ChangeLog:

* include/bits/chrono_io.h (__formatter_chrono:_M_s): Add missing
__out argument to format_to call.
* testsuite/std/time/format/empty_spec.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
libstdc++-v3/include/bits/chrono_io.h
libstdc++-v3/testsuite/std/time/format/empty_spec.cc