http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60572
Bug ID: 60572
Summary: [4.9 Regression] ICE deriving from class with invalid
member
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: error-recovery, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: reichelt at gcc dot gnu.org
The following invalid code snippet triggers an ICE on trunk:
========================
struct A
{
A x;
virtual ~A() {}
};
struct B : A
{
B() : A() {}
};
========================
bug.cc:3:5: error: field 'x' has incomplete type 'A'
A x;
^
bug.cc: In constructor 'B::B()':
bug.cc:9:11: internal compiler error: Segmentation fault
B() : A() {}
^
0xbab3df crash_signal
../../gcc/gcc/toplev.c:337
0xb9e5a7 bit_from_pos(tree_node*, tree_node*)
../../gcc/gcc/stor-layout.c:784
0x70d066 build_zero_init_1
../../gcc/gcc/cp/init.c:200
0x70db00 expand_aggr_init_1
../../gcc/gcc/cp/init.c:1768
0x710f30 emit_mem_initializers(tree_node*)
../../gcc/gcc/cp/init.c:1087
0x6c6af3 cp_parser_mem_initializer_list
../../gcc/gcc/cp/parser.c:12329
0x6c6af3 cp_parser_ctor_initializer_opt
../../gcc/gcc/cp/parser.c:12240
0x6c6af3 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:18757
0x6cc8b2 cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:22897
0x6d4c50 cp_parser_late_parsing_for_member
../../gcc/gcc/cp/parser.c:23573
0x6ae6e6 cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:19509
0x6b07b0 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:19533
0x6b07b0 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:14331
0x6c8c80 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:11567
0x6ce809 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11157
0x6b2983 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:11106
0x6d9022 cp_parser_declaration
../../gcc/gcc/cp/parser.c:11003
0x6d7d18 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:10889
0x6d95ca cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4030
0x6d95ca c_parse_file()
../../gcc/gcc/cp/parser.c:31645
Please submit a full bug report, [etc.]