[Bug libstdc++/124513] tzdata.zi parsing bug for TIME component of UNTIL field in Zone lines

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 31 10:55:54 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124513

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Tomasz Kaminski
<tkaminsk@gcc.gnu.org>:

https://gcc.gnu.org/g:de802d741d5fb2c34f65d95e6de6d67e47c0da4d

commit r14-12773-gde802d741d5fb2c34f65d95e6de6d67e47c0da4d
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat Mar 14 10:32:11 2026 +0000

    libstdc++: Fix time zone transitions for Rule changes during DST [PR116110]

    The Australia/Broken_Hill example in PR libstdc++/116110 demonstrates a
    bug in the time zone code. The current code gives incorrect results when
    a zone changes from one named Rule to another during DST, e.g. the
    Broken_Hill time zone uses:

      9:30    AN    AC%sT  2000
      9:30    AS    AC%sT

    So the AS Rules take effect on 2000 Jan 1 which is during DST (which
    runs from October to March).

    The fix for this is to update info.offset and info.save when we find an
    active rule, instead of only updating the 'letters' variable.

    The new tests for Pacific/Kiritimati and Pacific/Apia have some FIXME
    comments. The UNTIL times of the zone changes are incorrectly
    interpreted as UTC not wall time (due to the main topic of Bug 116110),
    and the "24" time for the Pacific/Apia zone is incorrectly ignored so
    that the change happens 24h too early (due to Bug 124513). Those tests
    will need to be adjusted later when the bugs are fixed.

    libstdc++-v3/ChangeLog:

            PR libstdc++/116110
            * src/c++20/tzdb.cc (time_zone::_M_get_sys_info): Update
            info.offset and info.save to values from the active rule.
            * testsuite/std/time/time_zone/116110.cc: New test.

    Reviewed-by: Tomasz KamiÅski <tkaminsk@redhat.com>
    (cherry picked from commit 663e5ade184813a8a5f6f76b873c3e212c1e8e75)


More information about the Gcc-bugs mailing list