public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine
@ 2023-07-31  7:37 hewillk at gmail dot com
  2023-07-31 23:07 ` [Bug c++/110855] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hewillk at gmail dot com @ 2023-07-31  7:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110855
           Summary: std::source_location doesn't work with C++20 coroutine
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

When I try to use source_location to debug C++ coroutine:

  auto initial_suspend(const std::source_location location =
                       std::source_location::current()) {
    return std::suspend_never{};
  }

I found that gcc does not allow this with:

  cc1plus: error: taking address of an immediate function 'static consteval 
  std::source_location std::source_location::current(__builtin_ret_type)'
  In function 'void bar(bar()::_Z3barv.Frame*)':

Not too sure if this is a valid code, although other compilers compile fine.

https://godbolt.org/z/qddrsvsT9

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

* [Bug c++/110855] std::source_location doesn't work with C++20 coroutine
  2023-07-31  7:37 [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine hewillk at gmail dot com
@ 2023-07-31 23:07 ` pinskia at gcc dot gnu.org
  2023-07-31 23:11 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-31 23:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 55669
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55669&action=edit
full testcase

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

* [Bug c++/110855] std::source_location doesn't work with C++20 coroutine
  2023-07-31  7:37 [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine hewillk at gmail dot com
  2023-07-31 23:07 ` [Bug c++/110855] " pinskia at gcc dot gnu.org
@ 2023-07-31 23:11 ` pinskia at gcc dot gnu.org
  2024-07-16 14:58 ` arsen at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-31 23:11 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-07-31
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |rejects-valid
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug c++/110855] std::source_location doesn't work with C++20 coroutine
  2023-07-31  7:37 [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine hewillk at gmail dot com
  2023-07-31 23:07 ` [Bug c++/110855] " pinskia at gcc dot gnu.org
  2023-07-31 23:11 ` pinskia at gcc dot gnu.org
@ 2024-07-16 14:58 ` arsen at gcc dot gnu.org
  2024-07-17 23:52 ` ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: arsen at gcc dot gnu.org @ 2024-07-16 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arsen at gcc dot gnu.org

--- Comment #3 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
hm, the testcase seems to work in 14.. but I don't see any obvious reason why
in the log

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

* [Bug c++/110855] std::source_location doesn't work with C++20 coroutine
  2023-07-31  7:37 [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine hewillk at gmail dot com
                   ` (2 preceding siblings ...)
  2024-07-16 14:58 ` arsen at gcc dot gnu.org
@ 2024-07-17 23:52 ` ppalka at gcc dot gnu.org
  2024-07-18  8:16 ` arsen at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-07-17 23:52 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |14.1.0, 15.0
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Seems to work since r14-4140.  We should probably add a regression test before
closing this.

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

* [Bug c++/110855] std::source_location doesn't work with C++20 coroutine
  2023-07-31  7:37 [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine hewillk at gmail dot com
                   ` (3 preceding siblings ...)
  2024-07-17 23:52 ` ppalka at gcc dot gnu.org
@ 2024-07-18  8:16 ` arsen at gcc dot gnu.org
  2024-07-30 12:05 ` arsen at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: arsen at gcc dot gnu.org @ 2024-07-18  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
agreed, but note that it still gives us the name of the actor function:

  pr110855.C:51:1ReturnObject bar(int)
  pr110855.C:51:1void bar(bar(int)::_Z3bari.Frame*)

(the latter print is from initial_suspend)

this is probably not ideal, but I'm unsure what that'd be expected to be anyway
(given that it's in a bunch of synthesized code)

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

* [Bug c++/110855] std::source_location doesn't work with C++20 coroutine
  2023-07-31  7:37 [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine hewillk at gmail dot com
                   ` (4 preceding siblings ...)
  2024-07-18  8:16 ` arsen at gcc dot gnu.org
@ 2024-07-30 12:05 ` arsen at gcc dot gnu.org
  2024-07-30 12:25 ` ppalka at gcc dot gnu.org
  2024-07-30 15:42 ` arsen at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: arsen at gcc dot gnu.org @ 2024-07-30 12:05 UTC (permalink / raw)
  To: gcc-bugs

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

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

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

--- Comment #6 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
should be OK on trunk now (since r15-2404) in the sense that we no longer
generate the name of the actor function and there's a regression test.

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

* [Bug c++/110855] std::source_location doesn't work with C++20 coroutine
  2023-07-31  7:37 [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine hewillk at gmail dot com
                   ` (5 preceding siblings ...)
  2024-07-30 12:05 ` arsen at gcc dot gnu.org
@ 2024-07-30 12:25 ` ppalka at gcc dot gnu.org
  2024-07-30 15:42 ` arsen at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-07-30 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |15.0

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

* [Bug c++/110855] std::source_location doesn't work with C++20 coroutine
  2023-07-31  7:37 [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine hewillk at gmail dot com
                   ` (6 preceding siblings ...)
  2024-07-30 12:25 ` ppalka at gcc dot gnu.org
@ 2024-07-30 15:42 ` arsen at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: arsen at gcc dot gnu.org @ 2024-07-30 15:42 UTC (permalink / raw)
  To: gcc-bugs

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

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |redbeard0531 at gmail dot com

--- Comment #7 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
*** Bug 102363 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2024-07-30 15:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31  7:37 [Bug c++/110855] New: std::source_location doesn't work with C++20 coroutine hewillk at gmail dot com
2023-07-31 23:07 ` [Bug c++/110855] " pinskia at gcc dot gnu.org
2023-07-31 23:11 ` pinskia at gcc dot gnu.org
2024-07-16 14:58 ` arsen at gcc dot gnu.org
2024-07-17 23:52 ` ppalka at gcc dot gnu.org
2024-07-18  8:16 ` arsen at gcc dot gnu.org
2024-07-30 12:05 ` arsen at gcc dot gnu.org
2024-07-30 12:25 ` ppalka at gcc dot gnu.org
2024-07-30 15:42 ` arsen 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).