This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Double the constructors, double the fun
- To: Timothy Housel <wileypob at yahoo dot com>
- Subject: Re: Double the constructors, double the fun
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 02 Aug 2001 18:02:39 -0300
- Cc: gcc-help at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <20010802153834.B19272@csociety.ecn.purdue.edu>
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