public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/114240] sys_days not being parsed with only a date in the stream
Date: Sat, 09 Mar 2024 00:29:36 +0000	[thread overview]
Message-ID: <bug-114240-4-EKDD0AMEXH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114240-4@http.gcc.gnu.org/bugzilla/>

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 <redi@gcc.gnu.org>:

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

commit r14-9406-g3e8ee03edd018eed43444755f601cdb9d5931654
Author: Jonathan Wakely <jwakely@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.

  parent reply	other threads:[~2024-03-09  0:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 15:11 [Bug libstdc++/114240] New: " howard.hinnant at gmail dot com
2024-03-05 15:21 ` [Bug libstdc++/114240] " redi at gcc dot gnu.org
2024-03-05 15:25 ` redi at gcc dot gnu.org
2024-03-05 15:31 ` howard.hinnant at gmail dot com
2024-03-05 15:53 ` redi at gcc dot gnu.org
2024-03-06 21:28 ` redi at gcc dot gnu.org
2024-03-07  0:10 ` redi at gcc dot gnu.org
2024-03-08 10:45 ` redi at gcc dot gnu.org
2024-03-09  0:29 ` cvs-commit at gcc dot gnu.org [this message]
2024-03-09  0:33 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114240-4-EKDD0AMEXH@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).