https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120821
Bug ID: 120821 Summary: ICE: in synthesize_implicit_template_parm, at cp/parser.cc:54331 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: rush102333 at gmail dot com Target Milestone: --- The following code starts to bailing out since gcc-6.1: https://godbolt.org/z/5bxP53fYo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ struct SS { static int xx; void foo(struct { auto qq() { return xx; }; } x); }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Stack Dump message on the trunk: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <source>:3:19: error: types may not be defined in parameter types 3 | void foo(struct { auto qq() { return xx; }; } x); | ^ <source>:3:49: internal compiler error: in synthesize_implicit_template_parm, at cp/parser.cc:54331 3 | void foo(struct { auto qq() { return xx; }; } x); | ^ 0x2828ff5 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x284a786 internal_error(char const*, ...) ???:0 0xae0b00 fancy_abort(char const*, int, char const*) ???:0 0xd08033 c_parse_file() ???:0 0xe6fb19 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~