https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107575
Bug ID: 107575 Summary: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Started with r11 : $ cat z1.cc void f (void) { virtual int f(void) const; virtual int f(void); } $ g++-13-20221106 -c z1.cc z1.cc: In function 'void f()': z1.cc:2:3: error: 'virtual' outside class declaration 2 | virtual int f(void) const; | ^~~~~~~ z1.cc:2:23: error: non-member function 'int f()' cannot have cv-qualifier 2 | virtual int f(void) const; | ^~~~~ z1.cc: At global scope: z1.cc:2:15: error: ambiguating new declaration of 'int f()' 2 | virtual int f(void) const; | ^ z1.cc:1:6: note: old declaration 'void f()' 1 | void f (void) { | ^ z1.cc: In function 'void f()': z1.cc:3:3: error: 'virtual' outside class declaration 3 | virtual int f(void); | ^~~~~~~ z1.cc:3:21: internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 3 | virtual int f(void); | ^ 0x70381d tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.cc:9020 0x8e2b53 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.h:3646 0x8e2b53 duplicate_decls(tree_node*, tree_node*, bool, bool) ../../gcc/cp/decl.cc:2605 0x9d1ba3 pushdecl(tree_node*, bool) ../../gcc/cp/name-lookup.cc:3686 0x8f026c start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../gcc/cp/decl.cc:5776 0xa32749 cp_parser_init_declarator ../../gcc/cp/parser.cc:22757 0xa05e62 cp_parser_simple_declaration ../../gcc/cp/parser.cc:15288 0xa07a19 cp_parser_declaration_statement ../../gcc/cp/parser.cc:14369 0xa080db cp_parser_statement ../../gcc/cp/parser.cc:12440 0xa09204 cp_parser_statement_seq_opt ../../gcc/cp/parser.cc:12857 0xa092e7 cp_parser_compound_statement ../../gcc/cp/parser.cc:12809 0xa31760 cp_parser_function_body ../../gcc/cp/parser.cc:25183 0xa31760 cp_parser_ctor_initializer_opt_and_function_body ../../gcc/cp/parser.cc:25234 0xa31dda cp_parser_function_definition_after_declarator ../../gcc/cp/parser.cc:31392 0xa3331c cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/cp/parser.cc:31309 0xa3331c cp_parser_init_declarator ../../gcc/cp/parser.cc:22637 0xa05e62 cp_parser_simple_declaration ../../gcc/cp/parser.cc:15288 0xa3aceb cp_parser_declaration ../../gcc/cp/parser.cc:14974 0xa3b808 cp_parser_translation_unit ../../gcc/cp/parser.cc:5080 0xa3b808 c_parse_file() ../../gcc/cp/parser.cc:48817