This is the mail archive of the gcc-help@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]

Re: Double the constructors, double the fun


On Aug  2, 2001, Timothy Housel <wileypob@yahoo.com> wrote:

> Why are there 2 constructors generated?

Have a look at the C++ ABI specification.  There's a link to it from
the readings page at gcc.gnu.org.

If I understand correctly, the issue is that there are two kinds of
constructors: those that take the responsibility of initializing any
virtual base classes themselves (used to construct the main object of
that type), and those that don't (used to construct sub-objects).

I suppose GCC could get both symbols to refer to the same chunk of
code in case a class doesn't have any virtual base classes, though.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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