https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122112
Bug ID: 122112
Summary: internal compiler error: crash at cp/parser.cc:55180
with anonymous struct in function parameter containing
auto
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: error-recovery, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: attackerj1113 at gmail dot com
Target Milestone: ---
The following code causes ICE on x86-64 gcc on trunk:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void fun(
struct
{
int xx;
auto qq() { return xx; }
} x
);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please check https://godbolt.org/z/hM9j9e4v3 for more info
Compiler Output:
<source>:4:5: error: types may not be defined in parameter types
4 | {
| ^
<source>:7:7: internal compiler error: in synthesize_implicit_template_parm, at
cp/parser.cc:55180
7 | } x
| ^
0x28cabd8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x28bfb0b internal_error(char const*, ...)
???:0
0xb0063a fancy_abort(char const*, int, char const*)
???:0
0xd35b83 c_parse_file()
???:0
0xea5f99 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