Vbase offsets

Jim Dehnert dehnert at baalbek.engr.sgi.com
Tue Apr 4 04:06:33 UTC 2000


> From: Mark Mitchell <mark at codesourcery.com>
> 
> We have:
> 
>   There is one virtual base offset entry for each direct virtual base
>   class, and one for each indirect virtual base class inherited via a
>   direct virtual base class. (Indirect virtual base classes inherited
>   via direct non-virtual base classes may be accessed via the the offset
>   stored in the base's vtable.) If an indirect virtual base class is
>   inherited via both virtual and non-virtual direct base classes, no
>   virtual base offset entry is included for it.
> 
> That seems to imply that a *direct* virtual base gets a new vbase
> offset, even it is also a direct virtual vbase of a direct non-virtual
> base. 
> 
> Example:
> 
>   struct S {};
>   struct T : virtual public S {};
>   struct U : public T, virtual public S {};
> 
> The language quoted seems to imply that `U' gets a vbase offset for
> `S'.  But, that seems unncessary: we already have one in `T's vtable.
> (Even if T were not the primary base, because it is a non-virtual
> base, we know where to find the offset, give a `U*'.)
> 
> Am I missing something?

I don't know about you, but we are.  This paragraph didn't get fixed
when we decided to always include vbase offsets for all virtual bases.
I've fixed it now (with the example) -- everyone please verify that it
matches our decisions.

Jim

-	    Jim Dehnert		dehnert at sgi.com
				(650)933-4272




More information about the cxx-abi-dev mailing list