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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:3e8ee03edd018eed43444755f601cdb9d5931654

commit r14-9406-g3e8ee03edd018eed43444755f601cdb9d5931654
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Fri Mar 8 16:15:57 2024 +0000

    libstdc++: Do not require a time-of-day when parsing sys_days [PR114240]

    When parsing a std::chrono::sys_days (or a sys_time with an even longer
    period) we should not require a time-of-day to be present in the input,
    because we can't represent that in the result type anyway.

    Rather than trying to decide which specializations should require a
    time-of-date and which should not, follow the direction of Howard
    Hinnant's date library, which allows extracting a sys_time of any period
    from input that only contains a date, defaulting the time-of-day part to
    00:00:00. This seems consistent with the intent of the standard, which
    says it's an error "If the parse fails to decode a valid date" (i.e., it
    doesn't care about decoding a valid time, only a date).

    libstdc++-v3/ChangeLog:

            PR libstdc++/114240
            * include/bits/chrono_io.h (_Parser::operator()): Assume
            hours(0) for a time_point, so that a time is not required
            to be present.
            * testsuite/std/time/parse/114240.cc: New test.

Reply via email to