Covariant returns

Mark Mitchell mark at codesourcery.com
Thu Jul 6 02:23:09 UTC 2000


>>>>> "Jason" == Jason Merrill <jason at cygnus.com> writes:

    >> In other words, when we read the document we are meant to think
    >> of the various covariant returns as different functions

    Jason> That's what I'm disagreeing with.  Why would we need to do
    Jason> so?

Well we need two entry points, right?  And there's no discussion of
covariant routines in vtable layout, etc.  So, we need to say
*something* about where that entry point goes.  I think we want to say
that when you already have `Base* Base::f()' and you override it with
`Derived* Derived::f' you treat that as if the user wrote `Base*
Derived::f' and also `Derived* Derived::fprime', i.e., override the
old entry and add a new one, in the place where fprime's entry would
otherwise go.

I don't think I'm saying anything remotely deep -- just that the spec
didn't say anything at all. :-)

    >> An ordinary human would think that the overriding function is
    >> just one function, not N where N is the number of covariant
    >> returns. :-)

    Jason> And so would I.  :)

No, no -- you're an *extraordinary* human...

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




More information about the cxx-abi-dev mailing list