diff options
author | XU Kailiang <xu2k3l4@outlook.com> | 2025-07-02 15:10:29 +0800 |
---|---|---|
committer | Tomasz KamiĆski <tkaminsk@redhat.com> | 2025-07-07 15:55:11 +0200 |
commit | 8ad5968a8dcb472cbff8e4c48217fd65e125b2f2 (patch) | |
tree | a56f2fcd5d1e7e11dbf78c11996ea05a769ffbe9 /gcc/c/config-lang.in | |
parent | 439b14e222571da76da2bfec04b9035fb9f1862d (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
C++ formatting locale could have a custom time_put that performs
differently from the C locale, so do not use __timepunct directly,
instead all of above specifiers use _M_locale_fmt.
For %a/%A/%b/%h/%B, the code handling the exception is now moved
to the _M_check_ok function, that is invoked before handling of the
conversion specifier. For time_points the values of months/weekday
are computed, and thus are always ok(), this information is indicated
by new _M_time_point member of the _ChronoSpec.
The different behavior of j specifier for durations and time_points/calendar
types, is now handled using only _ChronoParts, and _M_time_only in _ChronoSpec
is no longer needed, thus it was removed.
PR libstdc++/117214
libstdc++-v3/ChangeLog:
* include/bits/chrono_io.h (_ChronoSpec::_M_time_only): Remove.
(_ChronoSpec::_M_time_point): Define.
(__formatter_chrono::_M_parse): Use __parts to determine
interpretation of j.
(__formatter_chrono::_M_check_ok): Define.
(__formatter_chrono::_M_format_to): Invoke _M_check_ok.
(__formatter_chrono::_M_a_A, __formatter_chrono::_M_b_B): Move
exception throwing to _M_check_ok.
(__formatter_chrono::_M_j): Use _M_needs to define interpretation.
(__formatter_duration::_S_spec_for): Set _M_time_point.
* testsuite/std/time/format/format.cc: Test for exception for !ok()
months/weekday.
* testsuite/std/time/format/pr117214_custom_timeput.cc: New
test.
Co-authored-by: Tomasz Kaminski <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: XU Kailiang <xu2k3l4@outlook.com>
Signed-off-by: Tomasz Kaminski <tkaminsk@redhat.com>
Diffstat (limited to 'gcc/c/config-lang.in')
0 files changed, 0 insertions, 0 deletions