public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/112564] New: std::format(std::thread::id) is incorrectly left-aligned
@ 2023-11-16 10:38 blubban at gmail dot com
  2023-11-16 15:18 ` [Bug libstdc++/112564] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: blubban at gmail dot com @ 2023-11-16 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112564
           Summary: std::format(std::thread::id) is incorrectly
                    left-aligned
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: blubban at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/zra9GddY3

N4964 [thread.thread.id]/12 "If the align option is omitted it defaults to >."
Both MSVC and libc++ right-align thread::id here as mandated by that paragraph,
but libstdc++ is left-aligning.

I am not sure how duration should be aligned by default but either libstdc++ or
libc++ are buggy here.


Found by https://github.com/StephanTLavavej

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/112564] std::format(std::thread::id) is incorrectly left-aligned
  2023-11-16 10:38 [Bug libstdc++/112564] New: std::format(std::thread::id) is incorrectly left-aligned blubban at gmail dot com
@ 2023-11-16 15:18 ` redi at gcc dot gnu.org
  2023-11-16 15:21 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2023-11-16 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-11-16
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
   Target Milestone|---                         |13.3
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/112564] std::format(std::thread::id) is incorrectly left-aligned
  2023-11-16 10:38 [Bug libstdc++/112564] New: std::format(std::thread::id) is incorrectly left-aligned blubban at gmail dot com
  2023-11-16 15:18 ` [Bug libstdc++/112564] " redi at gcc dot gnu.org
@ 2023-11-16 15:21 ` redi at gcc dot gnu.org
  2023-11-16 15:21 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2023-11-16 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Alfred Agrell from comment #0)
> but libstdc++ is left-aligning.

Yes, that's a bug.

> I am not sure how duration should be aligned by default but either libstdc++
> or libc++ are buggy here.

chrono::duration is not an arithmetic type, so I think it should default to
left-aligned.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/112564] std::format(std::thread::id) is incorrectly left-aligned
  2023-11-16 10:38 [Bug libstdc++/112564] New: std::format(std::thread::id) is incorrectly left-aligned blubban at gmail dot com
  2023-11-16 15:18 ` [Bug libstdc++/112564] " redi at gcc dot gnu.org
  2023-11-16 15:21 ` redi at gcc dot gnu.org
@ 2023-11-16 15:21 ` redi at gcc dot gnu.org
  2023-11-16 17:20 ` cvs-commit at gcc dot gnu.org
  2023-11-16 17:21 ` redi at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2023-11-16 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.3                        |14.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/112564] std::format(std::thread::id) is incorrectly left-aligned
  2023-11-16 10:38 [Bug libstdc++/112564] New: std::format(std::thread::id) is incorrectly left-aligned blubban at gmail dot com
                   ` (2 preceding siblings ...)
  2023-11-16 15:21 ` redi at gcc dot gnu.org
@ 2023-11-16 17:20 ` cvs-commit at gcc dot gnu.org
  2023-11-16 17:21 ` redi at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-16 17:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS 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:23725aa53bd264941c4fb228227736be4da59761

commit r14-5536-g23725aa53bd264941c4fb228227736be4da59761
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Nov 16 16:11:18 2023 +0000

    libstdc++: Fix aligned formatting of stacktrace_entry and thread::id
[PR112564]

    The formatter for std::thread::id should default to right-align, and the
    formatter for std::stacktrace_entry should not just ignore the
    fill-and-align and width from the format-spec!

    libstdc++-v3/ChangeLog:

            PR libstdc++/112564
            * include/std/stacktrace (formatter::format): Format according
            to format-spec.
            * include/std/thread (formatter::format): Use _Align_right as
            default.
            * testsuite/19_diagnostics/stacktrace/output.cc: Check
            fill-and-align handling. Change compile test to run.
            * testsuite/30_threads/thread/id/output.cc: Check fill-and-align
            handling.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/112564] std::format(std::thread::id) is incorrectly left-aligned
  2023-11-16 10:38 [Bug libstdc++/112564] New: std::format(std::thread::id) is incorrectly left-aligned blubban at gmail dot com
                   ` (3 preceding siblings ...)
  2023-11-16 17:20 ` cvs-commit at gcc dot gnu.org
@ 2023-11-16 17:21 ` redi at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2023-11-16 17:21 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed, thanks for the report.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-16 17:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 10:38 [Bug libstdc++/112564] New: std::format(std::thread::id) is incorrectly left-aligned blubban at gmail dot com
2023-11-16 15:18 ` [Bug libstdc++/112564] " redi at gcc dot gnu.org
2023-11-16 15:21 ` redi at gcc dot gnu.org
2023-11-16 15:21 ` redi at gcc dot gnu.org
2023-11-16 17:20 ` cvs-commit at gcc dot gnu.org
2023-11-16 17:21 ` redi at gcc dot gnu.org

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).