https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121825
Bug ID: 121825
Summary: ICE on coroutine return in lambda
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: stevenxia990430 at gmail dot com
Target Milestone: ---
The following invalid program reports an internal compiler error: error
reporting routines re-entered. Failed on gcc-trunk.
To quickly reproduce: https://gcc.godbolt.org/z/3Pa4PzMzf
```
#include <coroutine>
template<int I>
auto lam() -> decltype([](int a){ co_return a; }(I)){ return 0; }
int main(){
auto x = lam<4>();
return 0;
}
```
Note that after changing `co_return` to just regular `return`, the program
compiles successfully.