http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59270
Bug ID: 59270
Summary: [4.9 Regression] [c++11] ICE with decltype of a broken
class
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
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 (compiled with "-std=c++11") triggers an ICE
on trunk:
====================
struct A
{
struct B b;
};
decltype(A()) a;
====================
bug.cc:3:12: error: field 'b' has incomplete type 'B'
struct B b;
^
bug.cc:6:12: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in type_build_ctor_call, at cp/class.c:5163
decltype(A()) a;
^
0xd5dc85 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/gcc/tree.c:9243
0x614ed6 tree_class_check
../../gcc/gcc/tree.h:2831
0x614ed6 type_build_ctor_call(tree_node*)
../../gcc/gcc/cp/class.c:5163
0x6bcdb7 build_value_init(tree_node*, int)
../../gcc/gcc/cp/init.c:339
0x6bc9ef build_value_init_noctor(tree_node*, int)
../../gcc/gcc/cp/init.c:412
0x6bce4c build_value_init(tree_node*, int)
../../gcc/gcc/cp/init.c:364
0x606e6b build_functional_cast(tree_node*, tree_node*, int)
../../gcc/gcc/cp/typeck2.c:1858
0x66c0b5 cp_parser_functional_cast
../../gcc/gcc/cp/parser.c:23013
0x666930 cp_parser_postfix_expression
../../gcc/gcc/cp/parser.c:5821
0x6675ec cp_parser_decltype_expr
../../gcc/gcc/cp/parser.c:11833
0x6675ec cp_parser_decltype
../../gcc/gcc/cp/parser.c:11932
0x67eb57 cp_parser_simple_type_specifier
../../gcc/gcc/cp/parser.c:14462
0x65f29d cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:14309
0x67634f cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:11476
0x67ce69 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11066
0x660e03 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:11015
0x6875a6 cp_parser_declaration
../../gcc/gcc/cp/parser.c:10912
0x686298 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:10798
0x687b6a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4018
0x687b6a c_parse_file()
../../gcc/gcc/cp/parser.c:31259
Please submit a full bug report, [etc.]