https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125343
Bug ID: 125343
Summary: ICE when parsing malformed lambda
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: s.kimura.h41104 at gmail dot com
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/ffo79PcrE
Reproducer:
```
void foo() {
[]< struct S {};
}
```
Backtrace:
<source>: In function 'void foo()':
<source>:2:15: error: types may not be defined in parameter types
2 | []< struct S {};
| ^
<source>:2:15: error: definition of 'struct foo()::<lambda>::S' inside template
parameter list
<source>:2:17: error: expected '>' before ';' token
2 | []< struct S {};
| ^
<source>:2:17: internal compiler error: in
record_lambda_scope_sig_discriminator, at cp/lambda.cc:1803
0x29d6af8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x29cb73b internal_error(char const*, ...)
???:0
0xb2fac0 fancy_abort(char const*, int, char const*)
???:0
0xd82993 c_parse_file()
???:0
0xf113f9 c_common_parse_file()
???:0
This seems a crash on invalid and goes back to gcc-15:
https://godbolt.org/z/5nh3so565