+2001-01-10 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (build_new_method_call): Use binfo_for_vbase.
+
2001-01-10 Joseph S. Myers <jsm28@cam.ac.uk>
* cp-tree.h (flag_cond_mismatch): Don't declare.
old ABI. */
name = constructor_p ? ctor_identifier : dtor_identifier;
}
- /* If we're call a subobject constructor or destructor for a
+ /* If we're a call to a constructor or destructor for a
subobject that uses virtual base classes, then we need to
pass down a pointer to a VTT for the subobject. */
else if ((name == base_ctor_identifier
{
tree vtt;
tree sub_vtt;
+ tree basebinfo = basetype_path;
/* If the current function is a complete object constructor
or destructor, then we fetch the VTT directly.
DECL_USE_VTT_PARM (current_function_decl),
DECL_VTT_PARM (current_function_decl),
vtt);
-
+ if (TREE_VIA_VIRTUAL (basebinfo))
+ basebinfo = binfo_for_vbase (basetype, current_class_type);
+ my_friendly_assert (BINFO_SUBVTT_INDEX (basebinfo), 20010110);
sub_vtt = build (PLUS_EXPR, TREE_TYPE (vtt), vtt,
- BINFO_SUBVTT_INDEX (basetype_path));
+ BINFO_SUBVTT_INDEX (basebinfo));
sub_vtt = build_indirect_ref (sub_vtt, NULL);
args = tree_cons (NULL_TREE, sub_vtt, args);
--- /dev/null
+// Build don't link:
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Jan 2001 <nathan@codesourcery.com>
+// Origin snyder@fnal.gov
+
+// Bug 933. Secondary vtables weren't correctly located for non-primary
+// virtual bases. Causing us to ICE.
+
+class d0_Object
+{
+public:
+virtual ~d0_Object ();
+};
+
+
+class M10 : virtual public d0_Object {};
+class M4 : virtual public M10 {};
+
+class M9
+: public M4, virtual public M10
+{
+public:
+M9 ();
+};
+
+M9::M9 () {}