This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] covariant abi conformance


Jason Merrill wrote:

OK, that tells us that we need to emit a thunk with such a mangled name.
In fact, we need it for use in more-derived classes, where the base may no
longer be primary.  However, I don't see why we need to use this thunk when
we know that no adjustment is necessary in the current class.  Seems to me
that the as-if rule applies here.
but it does not apply. The compiler emitting the vtable might not be
the one emitting the thunks.


What would be the point of such a thunk?  No, we need the thunk mentioned
above.  We just don't need to put it in the vtable.
What is the name of the thunk we put in the vtable? The only candidates are
_Zc_h0_<covariant>_<target> and _Zc_v0_<n>_<covariant>_<target>. The thunk
is overriding something from a virtual base, and the ABI says that's the
latter one. The ABI doesn't say use the former when overriding a virtual
primary base.

It is unfortunate we didn't notice this when designing the ABI.

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]