https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100853
Bug ID: 100853 Summary: internal compiler error: in cp_tree_equal, at cp/tree.c:4148 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: iii at linux dot ibm.com Target Milestone: --- $ cat cp-tree-equal.cpp typedef struct a *b; template <typename> struct c { d({ b *e; __typeof (*({ __typeof *e f; f} )).g const f (({ __typeof (*({ int h; f} )).g const f ( $ gcc/cc1plus -fno-PIE -g -O2 -fno-checking -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables cp-tree-equal.cpp ... cp-tree-equal.cpp:8:37: internal compiler error: in cp_tree_equal, at cp/tree.c:4148 8 | f} )).g const f ( | ^ 0x7062e9 cp_tree_equal(tree_node*, tree_node*) ../../gcc/cp/tree.c:4148 0xbd1d3e cp_tree_equal(tree_node*, tree_node*) ../../gcc/cp/tree.c:4138 0xbd1d3e cp_tree_equal(tree_node*, tree_node*) ../../gcc/cp/tree.c:4138 0xbd1d3e cp_tree_equal(tree_node*, tree_node*) ../../gcc/cp/tree.c:4138 0xbd1d3e cp_tree_equal(tree_node*, tree_node*) ../../gcc/cp/tree.c:4138 0xbdc784 structural_comptypes ../../gcc/cp/typeck.c:1491 0xae2ffc check_local_shadow ../../gcc/cp/name-lookup.c:3264 0xae2ffc do_pushdecl ../../gcc/cp/name-lookup.c:3773 0xae39b4 pushdecl(tree_node*, bool) ../../gcc/cp/name-lookup.c:3852 0xa3995e start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../gcc/cp/decl.c:5591 0xb2dd61 cp_parser_init_declarator ../../gcc/cp/parser.c:21802 0xb093cd cp_parser_simple_declaration ../../gcc/cp/parser.c:14487 0xb0b0a9 cp_parser_declaration_statement ../../gcc/cp/parser.c:13622 0xb0bc0b cp_parser_statement ../../gcc/cp/parser.c:11848 0xb0ce0e cp_parser_statement_seq_opt ../../gcc/cp/parser.c:12215 0xb0cee8 cp_parser_compound_statement ../../gcc/cp/parser.c:12164 0xb10473 cp_parser_statement_expr ../../gcc/cp/parser.c:5142 0xb10473 cp_parser_primary_expression ../../gcc/cp/parser.c:5549 0xb11b80 cp_parser_postfix_expression ../../gcc/cp/parser.c:7528 0xb243af cp_parser_unary_expression ../../gcc/cp/parser.c:8849 Found when reducing a testcase for another problem.