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++/115668] Cannot format chrono::duration<unsigned>
Date: Thu, 27 Jun 2024 08:48:54 +0000	[thread overview]
Message-ID: <bug-115668-4-0Xu7YN0Sjs@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115668-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 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:dafa750c8a6f0a088677871bfaad054881737ab1

commit r15-1690-gdafa750c8a6f0a088677871bfaad054881737ab1
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Jun 26 20:22:54 2024 +0100

    libstdc++: Fix std::format for chrono::duration with unsigned rep
[PR115668]

    Using std::chrono::abs is only valid if numeric_limits<rep>::is_signed
    is true, so using it unconditionally made it ill-formed to format a
    duration with an unsigned rep.

    The duration formatter might as negate the duration itself instead of
    using chrono::abs, because it already needs to check for a negative
    value.

    libstdc++-v3/ChangeLog:

            PR libstdc++/115668
            * include/bits/chrono_io.h (formatter<duration<R,P, C>::format):
            Do not use chrono::abs.
            * testsuite/20_util/duration/io.cc: Check formatting a duration
            with unsigned rep.

  parent reply	other threads:[~2024-06-27  8:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26 17:23 [Bug libstdc++/115668] New: " redi at gcc dot gnu.org
2024-06-26 17:30 ` [Bug libstdc++/115668] " redi at gcc dot gnu.org
2024-06-26 17:31 ` redi at gcc dot gnu.org
2024-06-27  8:48 ` cvs-commit at gcc dot gnu.org [this message]
2024-06-28 19:39 ` cvs-commit at gcc dot gnu.org
2024-06-28 19:39 ` cvs-commit at gcc dot gnu.org
2024-06-28 19:40 ` 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-115668-4-0Xu7YN0Sjs@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).