]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Report compilation error on formatting "%d" from month_last [PR120650]
authorTomasz Kamiński <tkaminsk@redhat.com>
Tue, 24 Jun 2025 07:17:12 +0000 (09:17 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Wed, 25 Jun 2025 08:46:02 +0000 (10:46 +0200)
commit190aaaaf077fe5f318e168a7a1e1aa57058f377e
treee0af7b9a4f7b3134833a9129e88bec5a387c2ebe
parent7fd6cb3c8488465ae0529f543f5309584961503d
libstdc++: Report compilation error on formatting "%d" from month_last [PR120650]

For month_day we incorrectly reported day information to be available, which lead
to format_error being thrown from the call to formatter::format at runtime, instead
of making call to format ill-formed.

The included test cover most of the combinations of _ChronoParts and format
specifiers.

PR libstdc++/120650

libstdc++-v3/ChangeLog:

* include/bits/chrono_io.h
(formatter<chrono::month_day_last,_CharT>::parse): Call _M_parse with
only Month being available.
* testsuite/std/time/format/data_not_present_neg.cc: New test.
libstdc++-v3/include/bits/chrono_io.h
libstdc++-v3/testsuite/std/time/format/data_not_present_neg.cc [new file with mode: 0644]