https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126423
Bug ID: 126423
Summary: ICE with expansion statement (that is empty) with
return and no return after and auto
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: c++26, ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
```
auto f() {
template for (auto x : {}) {
return x;
}
}
```
This causes an ICE:
<source>: In function 'auto f()':
<source>:5:1: warning: control reaches end of non-void function [-Wreturn-type]
5 | }
| ^
during RTL pass: expand
<source>:1:6: internal compiler error: in make_decl_rtl, at varasm.cc:1487
1 | auto f() {
| ^