https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96048
Bug ID: 96048 Summary: ICE in get_local_decls, at cp/name-lookup.c:3591 Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This invalid code, bug.cc, makes GCC-trunk ICE. $cat bug.cc struct a {template <class> class A;}; a : b ( auto ) ( class { }); $g++ -c -w bug.cc bug.cc:2:3: error: found ‘:’ in nested-name-specifier, expected ‘::’ 2 | a : b ( auto ) ( class { }); | ^ | :: bug.cc:2:18: error: template definition of non-template ‘struct a::<unnamed>’ 2 | a : b ( auto ) ( class { }); | ^~~~~ bug.cc:2:27: internal compiler error: in get_local_decls, at cp/name-lookup.c:3591 2 | a : b ( auto ) ( class { }); | ^ 0x63d349 get_local_decls() ../../gcc/cp/name-lookup.c:3591 0x97a185 pop_bindings_and_leave_scope() ../../gcc/cp/name-lookup.c:2065 0x9b0969 cp_parser_direct_declarator ../../gcc/cp/parser.c:21336 0x9b0969 cp_parser_declarator ../../gcc/cp/parser.c:21109 0x9c4ca6 cp_parser_init_declarator ../../gcc/cp/parser.c:20609 0x9a67a2 cp_parser_simple_declaration ../../gcc/cp/parser.c:13785 0x9cfa16 cp_parser_declaration ../../gcc/cp/parser.c:13484 0x9d015a cp_parser_translation_unit ../../gcc/cp/parser.c:4761 0x9d015a c_parse_file() ../../gcc/cp/parser.c:44043 0xae920b c_common_parse_file() ../../gcc/c-family/c-opts.c:1190 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $g++ --version ++ (GCC) 11.0.0 20200630 (experimental) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.