aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2006-11-28 02:19:02 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2006-11-28 02:19:02 +0000
commitb93029150149dce2e8d2d3948b5e8d7fbd14c26e (patch)
treed439c6902f5d8d68b1501c9595436af9dc85835f
parentdf69b58cd5ad1d5ba162e3a5a6337b0ee34c64e8 (diff)
downloadgcc-b93029150149dce2e8d2d3948b5e8d7fbd14c26e.zip
gcc-b93029150149dce2e8d2d3948b5e8d7fbd14c26e.tar.gz
gcc-b93029150149dce2e8d2d3948b5e8d7fbd14c26e.tar.bz2
class.c (build_vcall_offset_vtbl_entries): Do not add vcall entries for a primary construction virtual table.
* class.c (build_vcall_offset_vtbl_entries): Do not add vcall entries for a primary construction virtual table. From-SVN: r119271
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/class.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 095c2fe..076abea 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-27 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (build_vcall_offset_vtbl_entries): Do not add vcall
+ entries for a primary construction virtual table.
+
2006-11-26 Mark Mitchell <mark@codesourcery.com>
PR c++/29886
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 3e569f5..6b195fb1 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -7449,7 +7449,14 @@ build_vcall_offset_vtbl_entries (tree binfo, vtbl_init_data* vid)
/* We only need these entries if this base is a virtual base. We
compute the indices -- but do not add to the vtable -- when
building the main vtable for a class. */
- if (BINFO_VIRTUAL_P (binfo) || binfo == TYPE_BINFO (vid->derived))
+ if (binfo == TYPE_BINFO (vid->derived)
+ || (BINFO_VIRTUAL_P (binfo)
+ /* If BINFO is RTTI_BINFO, then (since BINFO does not
+ correspond to VID->DERIVED), we are building a primary
+ construction virtual table. Since this is a primary
+ virtual table, we do not need the vcall offsets for
+ BINFO. */
+ && binfo != vid->rtti_binfo))
{
/* We need a vcall offset for each of the virtual functions in this
vtable. For example: