http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59082

            Bug ID: 59082
           Summary: [4.7/4.8/4.9 Regression] ICE with duplicate (virtual)
                    base
           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 triggers an ICE since GCC 4.2.0:

================================
struct A {};

struct B : virtual A, A {};

A foo(const B &b)
{
  return b;
}
================================

bug.cc:3:23: error: duplicate base type 'A' invalid
 struct B : virtual A, A {};
                       ^
bug.cc: In function 'A foo(const B&)':
bug.cc:7:10: internal compiler error: Segmentation fault
   return b;
          ^
0xb2a93f crash_signal
        ../../gcc/gcc/toplev.c:334
0x618b2d contains_struct_check
        ../../gcc/gcc/tree.h:2819
0x618b2d build_vfield_ref(tree_node*, tree_node*)
        ../../gcc/gcc/cp/class.c:639
0x61816b build_base_path(tree_code, tree_node*, tree_node*, int, int)
        ../../gcc/gcc/cp/class.c:429
0x553a0c convert_like_real
        ../../gcc/gcc/cp/call.c:6108
0x552e1e convert_like_real
        ../../gcc/gcc/cp/call.c:6086
0x55491c build_over_call
        ../../gcc/gcc/cp/call.c:6944
0x550f3e build_new_method_call_1
        ../../gcc/gcc/cp/call.c:7814
0x550f3e build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ../../gcc/gcc/cp/call.c:7884
0x551e87 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        ../../gcc/gcc/cp/call.c:7441
0x553223 build_temp
        ../../gcc/gcc/cp/call.c:5784
0x553223 convert_like_real
        ../../gcc/gcc/cp/call.c:6128
0x5576d9 perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
        ../../gcc/gcc/cp/call.c:9019
0x6853c3 check_return_expr(tree_node*, bool*)
        ../../gcc/gcc/cp/typeck.c:8538
0x6c4bde finish_return_stmt(tree_node*)
        ../../gcc/gcc/cp/semantics.c:798
0x64d726 cp_parser_jump_statement
        ../../gcc/gcc/cp/parser.c:10590
0x64d726 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9284
0x64dcb9 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:9654
0x64de2e cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:9608
0x6614cb cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:18461
Please submit a full bug report, [etc.]

Reply via email to