[Bug c++/60629] New: [c++11] ICE initializing array of function pointers with auto
reichelt at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Mar 23 20:33:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60629
Bug ID: 60629
Summary: [c++11] ICE initializing array of function pointers
with auto
Product: gcc
Version: 4.9.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
The following (valid?) code snippet (compiled with "-std=c++11" or
"-std=c++0x"for older compilers) triggers an ICE since GCC 4.4.0
(when auto was introduced):
====================================
void foo(int i)
{
auto(*p)[i] = (int(*)[i])0;
}
====================================
bug.cc: In function 'void foo(int)':
bug.cc:3:28: internal compiler error: in unify_array_domain, at cp/pt.c:17272
auto(*p)[i] = (int(*)[i])0;
^
0x638602 unify_array_domain
../../gcc/gcc/cp/pt.c:17272
0x6355df unify
../../gcc/gcc/cp/pt.c:17821
0x635303 unify
../../gcc/gcc/cp/pt.c:17802
0x638bd7 unify_one_argument
../../gcc/gcc/cp/pt.c:16338
0x63afec type_unification_real
../../gcc/gcc/cp/pt.c:16410
0x648d1a do_auto_deduction(tree_node*, tree_node*, tree_node*)
../../gcc/gcc/cp/pt.c:21663
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
0x6ce9e9 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11225
Please submit a full bug report, [etc.]
More information about the Gcc-bugs
mailing list