Vcall offsets

Mark Mitchell mark at codesourcery.com
Tue Apr 18 22:12:42 UTC 2000


  Once again, I'll take a shot at this one, but please correct my
  misconceptions.

Thanks.

  I agree with your objective, but would come to a different interpretation.
  I would state the rule for what's included as follows:

   1) First, whatever's required by the primary base class.

   2) Next, anything additional (not overrides of the primary base) from
      the class being laid out.

   3) Finally, anything additional from the base classes, in declaration
      preorder for the bases, declaration order for the functions within
      the bases.

  So, I think we need a vcall offset for C::g (2) but not for B::g (3).
  Not a functional difference, but it affects the ordering.

I have no objection to the order you suggest.

  So, applying the above rule, I would get (with the rule number in
  parentheses):

	  B::h  (3)
	  C::g  (2)
	  A::f  (1)

I was actually trying to clarify something different here.  If `f'
appears before `g' in the class declaration, does the vcall offset for
`f' appear before, or after, `g' in the vtable layout?  (Assuming
neither is overridden, so we don't get the complications being
discussed above.)

Thanks,

--
Mark Mitchell                   mark at codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com




More information about the cxx-abi-dev mailing list