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

            Bug ID: 125313
           Summary: ICE in coroutine handling with incomplete
                    std::coroutine_handle declaration and co_await
                    expression
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: s.kimura.h41104 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/a1PfTjKKs

Reproducer:
```
namespace std {
template <class P = void> struct coroutine_handle;

template <> struct coroutine_handle<void> {
  void *address() const;
};

template <class ::E, class... Args> struct coroutine_traits {};
} // namespace std

struct S {
} s;

void foo() { co_await s; }
```

Backtrace:
<source>:14:23: internal compiler error: in dependent_type_p, at cp/pt.cc:29630
   14 | void foo() { co_await s; }
      |                       ^
0x29d6748 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x29cb38b internal_error(char const*, ...)
        ???:0
0xb2f91a fancy_abort(char const*, int, char const*)
        ???:0
0xbce52f finish_co_await_expr(unsigned long, tree_node*)
        ???:0
0xd827e3 c_parse_file()
        ???:0
0xf11049 c_common_parse_file()
        ???:0

This seems a crash on invalid and goes back to gcc-16:
https://godbolt.org/z/xa1vPnrY7

Reply via email to