https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110978
Bug ID: 110978
Summary: [14 Regression] ICE lambda constrained with
to-be-deduced object
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: johelegp at gmail dot com
CC: johelegp at gmail dot com
Target Milestone: ---
See <https://compiler-explorer.com/z/3a87zrhqd>.
```C++
int f(int);
int main() {
auto f = [](auto obj) requires requires { f(obj); } { return f(obj); }(0);
}
```
```output
<source>: In function 'int main()':
<source>:3:45: error: use of 'f' before deduction of 'auto'
3 | auto f = [](auto obj) requires requires { f(obj); } { return f(obj);
}(0);
| ^
<source>:3:12: error: constraints on a non-templated function
3 | auto f = [](auto obj) requires requires { f(obj); } { return f(obj);
}(0);
| ^
<source>:3:53: internal compiler error: in dependent_type_p, at cp/pt.cc:27895
3 | auto f = [](auto obj) requires requires { f(obj); } { return f(obj);
}(0);
| ^
0x24742fe internal_error(char const*, ...)
???:0
0xaca188 fancy_abort(char const*, int, char const*)
???:0
0xb8c067 start_preparsed_function(tree_node*, tree_node*, int)
???:0
0xbeaac9 start_lambda_function(tree_node*, tree_node*)
???:0
0xcb0974 c_parse_file()
???:0
0xdf1599 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```