http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59096
Bug ID: 59096
Summary: [4.9 Regression] [c++11] ICE with template attribute
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 valid code snippet (compiled with "-std=c++11") triggers an ICE
on trunk:
====================================
template<typename T> struct A
{
typedef T B [[mode]];
};
A<int>::B b;
====================================
bug.cc: In instantiation of 'struct A<int>':
bug.cc:6:7: required from here
bug.cc:3:22: internal compiler error: Segmentation fault
typedef T B [[mode]];
^
0xb2bf3f crash_signal
../../gcc/gcc/toplev.c:334
0x5beaf8 contains_struct_check
../../gcc/gcc/tree.h:2819
0x5beaf8 apply_late_template_attributes
../../gcc/gcc/cp/pt.c:8618
0x5cd569 tsubst_decl
../../gcc/gcc/cp/pt.c:10976
0x5bbf6c tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:11325
0x5e98f0 instantiate_class_template_1
../../gcc/gcc/cp/pt.c:8974
0x5e98f0 instantiate_class_template(tree_node*)
../../gcc/gcc/cp/pt.c:9238
0x677563 complete_type(tree_node*)
../../gcc/gcc/cp/typeck.c:132
0x652b5a cp_parser_nested_name_specifier_opt
../../gcc/gcc/cp/parser.c:5377
0x66120e cp_parser_constructor_declarator_p
../../gcc/gcc/cp/parser.c:22246
0x66120e cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:11434
0x667d39 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11039
0x64bdf0 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:10988
0x66f8a7 cp_parser_declaration
../../gcc/gcc/cp/parser.c:10885
0x66e5c8 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:10771
0x66fe56 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4007
0x66fe56 c_parse_file()
../../gcc/gcc/cp/parser.c:31107
0x791013 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1055
Please submit a full bug report, [etc.]
The regression appeared between 4.9.0 20131012 and 4.9.0 20131019.