This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Double constructors in C++?


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


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