class.c (add_vcall_offset_vtbl_entries_1): Only add one entry for a destructor.
authorMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 18 Feb 2001 20:41:10 +0000 (20:41 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 18 Feb 2001 20:41:10 +0000 (20:41 +0000)
* class.c (add_vcall_offset_vtbl_entries_1): Only add one entry
for a destructor.

From-SVN: r39847

gcc/cp/ChangeLog
gcc/cp/class.c

index 990529165768a4b01f41633ab77ae926ff20936b..0f94cec1354c90f3949ee444cd94061a6d08384a 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-18  Mark Mitchell  <mark@codesourcery.com>
+
+       * class.c (add_vcall_offset_vtbl_entries_1): Only add one entry
+       for a destructor.
+
 2001-02-18  Jason Merrill  <jason@redhat.com>
 
        Do put the VTT parameter in DECL_ARGUMENTS.
@@ -1060,7 +1065,8 @@ Sun Feb  4 15:52:44 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * class.c (check_field_decls): Don't special case anonymous
        fields in error messages.
-       (note_name_declared_in_class): Use %D on diagnostic.
+       (note_name_declared_inpwdpwd
+       _class): Use %D on diagnostic.
 
        * tree.c (pod_type_p): Use strip_array_types.
        (cp_valid_lang_attribute): Likewise.
index b1b4180fd67993214e9db7b50f3e686574b9762a..6752c90db9109e3cf17625a88405b4da4c9f6a19 100644 (file)
@@ -7689,7 +7689,11 @@ add_vcall_offset_vtbl_entries_1 (binfo, vid)
          tree derived_entry;
 
          derived_entry = VARRAY_TREE (vid->fns, i);
-         if (same_signature_p (BV_FN (derived_entry), fn))
+         if (same_signature_p (BV_FN (derived_entry), fn)
+             /* We only use one vcall offset for virtual destructors,
+                even though there are two virtual table entries.  */
+             || (DECL_DESTRUCTOR_P (BV_FN (derived_entry))
+                 && DECL_DESTRUCTOR_P (fn)))
            {
              BV_VCALL_INDEX (derived_virtuals) 
                = BV_VCALL_INDEX (derived_entry);