This is the mail archive of the
mailing list for the GCC project.
Re: Double constructors in C++?
- From: Ian Lance Taylor <iant at google dot com>
- To: Samuel Tardieu <sam at rfc1149 dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: 18 Feb 2008 18:44:41 -0800
- Subject: Re: Double constructors in C++?
- References: <email@example.com>
Samuel Tardieu <firstname.lastname@example.org> writes:
> Why are constructors included twice in object code?
This is required by the C++ ABI.
It is, in my opinion, a real bug that gcc does not simply merge
identical constructors. There are ABI issues with changing, in that
it can change the behaviour of existing code in some very subtle ways
that will probably not break any actual existing code. We should at
the very least offer this as an ABI_-breaking option for people using
embedded systems or other cases where code size matters.
There is a bug report at http://gcc.gnu.org/PR3187 .
The last patch I know of related to this was
> 00000000 <_ZN1TC2ERKSs>:
> 0000000c <_ZN1TC1ERKSs>:
Note that although the demangler demangles them to the same string,
the two functions have different names.