This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/84812] New: [8 Regression] ICE with local function


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84812

            Bug ID: 84812
           Summary: [8 Regression] ICE with local function
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
                CC: nathan at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE on trunk:

==============================
struct A { void foo(); };
struct B { void foo(); };

struct C : A, B
{
  C()
  {
    void foo();
  }
};
==============================

bug.cc: In constructor 'C::C()':
bug.cc:8:14: internal compiler error: tree check: expected tree that contains
'decl common' structure, have 'tree_list' in set_local_extern_decl_linkage, at
cp/name-lookup.c:2886
     void foo();
              ^
0x78c545 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ../../gcc/gcc/tree.c:9507
0x623f07 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        ../../gcc/gcc/tree.h:3246
0x623f07 set_local_extern_decl_linkage
        ../../gcc/gcc/cp/name-lookup.c:2886
0x623f07 do_pushdecl
        ../../gcc/gcc/cp/name-lookup.c:3011
0x623f07 pushdecl(tree_node*, bool)
        ../../gcc/gcc/cp/name-lookup.c:3154
0x8aa093 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc/gcc/cp/decl.c:5197
0x93ae39 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:19598
0x942578 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:13057
0x943388 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:12882
0x943db9 cp_parser_declaration_statement
        ../../gcc/gcc/cp/parser.c:12476
0x922433 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:10925
0x9233a0 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11274
0x923477 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:11228
0x939f00 cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:21776
0x939f00 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:21813
0x93a7b0 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:26828
0x93c49c cp_parser_late_parsing_for_member
        ../../gcc/gcc/cp/parser.c:27708
0x92e6c3 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:22752
0x92fad9 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:22778
0x92fad9 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:16774
Please submit a full bug report, [etc.]

The regression was introduced between 2017-05-19 and 2017-05-25.

Nathan, this might be caused by your name-lookup changes.
Would you mind having a look?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]