diff options
Diffstat (limited to 'gcc/cp/init.c')
| -rw-r--r-- | gcc/cp/init.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 1f172d2b2f5..ea38333d776 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -716,15 +716,14 @@ build_vtbl_address (tree binfo) tree binfo_for = binfo; tree vtbl; - if (BINFO_VPTR_INDEX (binfo) && BINFO_VIRTUAL_P (binfo) - && BINFO_PRIMARY_P (binfo)) + if (BINFO_VPTR_INDEX (binfo) && BINFO_VIRTUAL_P (binfo)) /* If this is a virtual primary base, then the vtable we want to store is that for the base this is being used as the primary base of. We can't simply skip the initialization, because we may be expanding the inits of a subobject constructor where the virtual base layout can be different. */ - while (BINFO_PRIMARY_BASE_OF (binfo_for)) - binfo_for = BINFO_PRIMARY_BASE_OF (binfo_for); + while (BINFO_PRIMARY_P (binfo_for)) + binfo_for = BINFO_INHERITANCE_CHAIN (binfo_for); /* Figure out what vtable BINFO's vtable is based on, and mark it as used. */ |

