[Bug c++/123670] [14/15/16 Regression] ICE (Segmentation fault) in constraints_satisfied_p with lambda requires clause referencing captured local lambda
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 20 02:55:30 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123670
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2026-01-20
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
A related rejects valid testcase:
```
template <typename T=int>
void foo () {
constexpr auto g = []() { return true; };
auto lambda = [](auto x) -> int requires (g()) { return 0;};
lambda(42);
}
int main()
{
foo ();
}
```
Changing foo to a non-template and GCC accepts the code.
More information about the Gcc-bugs
mailing list