This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: (C++) COM patch -- allow multiple COM base classes
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Re: (C++) COM patch -- allow multiple COM base classes
- From: Mumit Khan <khan at xraylith dot wisc dot EDU>
- Date: Wed, 09 Jun 1999 13:01:31 -0500
- cc: egcs-patches at egcs dot cygnus dot com
Jason Merrill <jason@cygnus.com> writes:
> >>>>> Mumit Khan <khan@xraylith.wisc.EDU> writes:
>
> > The following fixes a following bug in creating COM classes with multiple
> > multiple base classes, all of which are also COM.
>
> Does that work? I had been thinking that COM would only work with leftmost
> bases, but I suppose there's no good reason to think that. I suppose the
> only real distinction of COM classes is that the vtable layout is
> different, and the vptr must be at the beginning of the object. So the
> leftmost base of a COM interface must also be a COM interface, and COM-ness
> is inherited from the leftmost base, but subsequent bases can be COM or
> not, and it doesn't matter.
>
> Make sense?
MSVC doesn't seem to care what order the bases are in as long as one of
the bases is COM. This is probably due to way vtable layout MS uses. For
GCC however, it's probably necessary to have the leftmost base to be COM
to get the right vptr, but after that it shouldn't matter at all.
I didn't know if you had any special reasons to disallow non-COM even
after the leftmost, so I left it alone. Good thing because I then noticed
your patch from 5/20, which does allow non-COM bases.
Regards,
Mumit