[Bug libstdc++/124852] std::chrono::time_zone misparses Zone UNTIL fields whose DAY uses the ON format (lastSun, Sun>=8, etc.)

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124852

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Tomasz Kaminski
<[email protected]>:

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

commit r15-11430-gf47d0c439c9cd90b78fa1c26710739ad5e2224c2
Author: Tomasz KamiÅski <[email protected]>
Date:   Wed May 13 09:17:47 2026 +0200

    libstdc++: Use on_month_day istream operator in ZoneInfo parsing.
[PR124852]

    This patch changes ZoneInfo parsing, to use operator>> for on_month_day
    directly, and removes on_day tag. The operator>>(istream&, on_month_day)
    is updated to not override on.month if the MONTH component is not present,
    and set failbit instead. This allows to use in >> on >> time, to parse
    MONTH DAY TIME.

    We also handle failure to parse day number N for Www>=N or Www<=N
    productions, by leaving the day part of input unchanged and setting
    failbit.

            PR libstdc++/124852

    libstdc++-v3/ChangeLog:

            * src/c++20/tzdb.cc (on_month_day::on_day_t, on_month_day::on_day):
            Remove.
            (operator>>(istream&, on_month_day::day_t&)): Inlined into...
            (operator>>(istream&, on_month_day)): Inlined on_month_day::on_day.
            Avoid modifying on.month if MONTH is not present. Report failure
            on failure to parse day for LessEq / GreaterEq.

    Reviewed-by: Jonathan Wakely <[email protected]>
    Signed-off-by: Tomasz KamiÅski <[email protected]>
    (cherry picked from commit 2451667193e4e00b49c4ef9d95c0a3a1aa955f82)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.