This is the mail archive of the
gcc@gcc.gnu.org
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: <2008-02-18-23-56-19+trackit+sam@rfc1149.net>
Samuel Tardieu <sam@rfc1149.net> 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
http://gcc.gnu.org/ml/gcc-patches/2007-11/msg01147.html .
> 00000000 <_ZN1TC2ERKSs>:
> 0000000c <_ZN1TC1ERKSs>:
Note that although the demangler demangles them to the same string,
the two functions have different names.
Ian