http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60628
Bug ID: 60628
Summary: [4.7/4.8/4.9 Regression] [c++11] ICE initializing
array of auto
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: 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 (compiled with "-std=c++11" or
"-std=c++0x" for older compilers) triggers an ICE since GCC 4.6.0:
=================================
#include <initializer_list>
void foo(int i)
{
auto x[i] = { 0 };
}
=================================
bug.cc: In function 'void foo(int)':
bug.cc:5:19: internal compiler error: in tsubst_copy, at cp/pt.c:13032
auto x[i] = { 0 };
^
0x62bba3 tsubst_copy
../../gcc/gcc/cp/pt.c:13032
0x60a6a6 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:15287
0x614496 tsubst_expr
../../gcc/gcc/cp/pt.c:13980
0x61dc56 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:11597
0x61cf47 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:12046
0x648e17 listify_autos
../../gcc/gcc/cp/pt.c:21612
0x648e17 do_auto_deduction(tree_node*, tree_node*, tree_node*)
../../gcc/gcc/cp/pt.c:21636
0x5db251 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:6198
0x6cd22d cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:16858
0x6ce9e9 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11225
0x6b2983 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:11106
0x6b3aa1 cp_parser_declaration_statement
../../gcc/gcc/cp/parser.c:10753
0x6b40eb cp_parser_statement
../../gcc/gcc/cp/parser.c:9486
0x6b4f39 cp_parser_statement_seq_opt
../../gcc/gcc/cp/parser.c:9764
0x6b50a6 cp_parser_compound_statement
../../gcc/gcc/cp/parser.c:9718
0x6c62db cp_parser_function_body
../../gcc/gcc/cp/parser.c:18736
0x6c62db cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:18772
0x6cc8b2 cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:22897
0x6cd75f cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/gcc/cp/parser.c:22809
0x6cd75f cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:16628
Please submit a full bug report, [etc.]