https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123536
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2026-01-12
Summary|[16 Regression] ICE in |[16 Regression] ICE in
|mark_use, at cp/expr.cc:190 |mark_use with lambda
| |reference to a global
| |without captures inside a
| |template
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=122163
Ever confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. The ICE is new in GCC 16 but this has been rejected always it seems.
Reduced testcase:
```
int globalCounter = 0;
template<int=1>
void inline_invoke() {
int &counterRef = globalCounter;
auto lamda = []() { counterRef++; };
}
```
The non-template one was fixed for GCC 8.