[Bug c++/60054] New: [c++1y] ICE with auto* cast
reichelt at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 4 07:29:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60054
Bug ID: 60054
Summary: [c++1y] ICE with auto* cast
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++1y") triggers an
ICE on trunk:
==================================
template<typename T> T foo(T);
void bar()
{
foo((auto*)0);
}
==================================
cc1plus: internal compiler error: Segmentation fault
0xba9c8f crash_signal
../../gcc/gcc/toplev.c:337
0x8812b4 tree_check
../../gcc/gcc/tree.h:2918
0x8812b4 decl_assembler_name_hash
../../gcc/gcc/symtab.c:98
0x88171f insert_to_assembler_name_hash
../../gcc/gcc/symtab.c:209
0x881871 symtab_initialize_asm_name_hash
../../gcc/gcc/symtab.c:432
0x88ff22 analyze_functions
../../gcc/gcc/cgraphunit.c:1124
0x891425 finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2320
0x68c4ae cp_write_global_declarations()
../../gcc/gcc/cp/decl2.c:4449
Please submit a full bug report, [etc.]
With a slightly modified example I get a different stack trace:
===========================================
template<typename T> decltype(T{}) foo(T);
void bar()
{
foo((auto*)0);
}
===========================================
bug.cc: In function 'void bar()':
bug.cc:5:15: internal compiler error: in cxx_incomplete_type_diagnostic, at
cp/typeck2.c:553
foo((auto*)0);
^
0x651b3f cxx_incomplete_type_diagnostic(tree_node const*, tree_node const*,
diagnostic_t)
../../gcc/gcc/cp/typeck2.c:553
0x6de719 complete_type_or_maybe_complain(tree_node*, tree_node*, int)
../../gcc/gcc/cp/typeck.c:153
0x6de7a9 require_complete_type_sfinae
../../gcc/gcc/cp/typeck.c:90
0x5a6389 build_cxx_call(tree_node*, int, tree_node**, int)
../../gcc/gcc/cp/call.c:7301
0x5b8a1d build_over_call
../../gcc/gcc/cp/call.c:7225
0x5ba3a1 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
../../gcc/gcc/cp/call.c:3967
0x730ec4 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
../../gcc/gcc/cp/semantics.c:2348
0x6b4dc1 cp_parser_postfix_expression
../../gcc/gcc/cp/parser.c:6164
0x6b7966 cp_parser_unary_expression
../../gcc/gcc/cp/parser.c:7170
0x6b868f cp_parser_binary_expression
../../gcc/gcc/cp/parser.c:7874
0x6b8b81 cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:8112
0x6baf64 cp_parser_expression
../../gcc/gcc/cp/parser.c:8274
0x6bb79c cp_parser_expression
../../gcc/gcc/cp/parser.c:8313
0x6bb79c cp_parser_expression_statement
../../gcc/gcc/cp/parser.c:9622
0x6b0c38 cp_parser_statement
../../gcc/gcc/cp/parser.c:9473
0x6b1a09 cp_parser_statement_seq_opt
../../gcc/gcc/cp/parser.c:9745
0x6b1b76 cp_parser_compound_statement
../../gcc/gcc/cp/parser.c:9699
0x6c5d5b cp_parser_function_body
../../gcc/gcc/cp/parser.c:18641
0x6c5d5b cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:18677
0x6ca0a2 cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:22792
Please submit a full bug report, [etc.]
More information about the Gcc-bugs
mailing list