[Bug libstdc++/116110] Transitions obtained from chrono::time_zone::get_info should not treat times as UTC
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 19 11:45:20 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:cddf4111c4c4383f8d686ab822a9f3fc3ed6db44
commit r16-8168-gcddf4111c4c4383f8d686ab822a9f3fc3ed6db44
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon Mar 16 21:48:30 2026 +0000
libstdc++: Partial fix for interpretation of non-UTC UNTIL times in
tzdata.zi [PR116110]
This is a partial fix for PR 116110, so that zone changes that occur at
a time specified as standard time will be parsed correctly. Previously
all UNTIL times were assumed to be UTC, which is incorrect according to
the spec. Only times with a 'u' suffix (or the equivalent 'g' or 'z')
are UTC times. An 's' suffix means standard time (i.e. the zone's usual
offset from UTC, without any DST adjustment) and a 'w' suffix (or no
suffix) means wall time, so the offset and any DST adjustment. This
commit fixes the handling of 's' suffixes, so that the ZoneInfo::m_until
member is set correctly. It also fixes the handling of some UNTIL times
using wall time, specifically those where the DST adjustment is known
during parsing of the tzdata.zi file.
This is not a complete fix, because as noted in PR 116110 a Zone line
that refers to a named Rule and uses wall time cannot be determined
while parsing tzdata.zi. We need to remember that the m_until member is
not correct, and then adjust it later when we find the rule that applies
at a given time point. That requires more work.
Some existing tests need to be adjusted due to the fixes in this commit.
The std/time/time_zone/get_info_sys.cc and std/time/zoned_time/1.cc
tests are corrected to check that the changes happens at midnight local
time, not midnight UTC as previously assumed.
One of the FIXME comments in std/time/time_zone/116110.cc can be removed
now, because the UNTIL time is correctly interpreted as midnight local
time. The other FIXME needs to be changed to midnight at the local
standard time, which is still wrong but we don't currently adjust it for
the DST save time of one hour. It also still needs the incorrect +24h
due to Bug 124513.
libstdc++-v3/ChangeLog:
PR libstdc++/116110
* src/c++20/tzdb.cc (operator>>(istream&, ZoneInfo&)): Adjust
inf.m_until according to indicator suffix on AT time in UNTIL.
* testsuite/std/time/time_zone/116110.cc (test_kiritimati):
Remove FIXME now that the UNTIL time is adjusted for STDOFF.
(test_apia): Adjust FIXME now that UNTIL time is adusted for
STDOFF.
* testsuite/std/time/time_zone/get_info_sys.cc: Adjust expected
results to account for corrected logic.
* testsuite/std/time/zoned_time/1.cc: Likewise.
Reviewed-by: Tomasz KamiÅski <tkaminsk@redhat.com>
More information about the Gcc-bugs
mailing list