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

Reply via email to