This is the mail archive of the
mailing list for the GCC project.
Re: libstdc++ PATCH to add abi tag to complex::real/imag
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 11 Nov 2012 09:08:19 +0100 (CET)
- Subject: Re: libstdc++ PATCH to add abi tag to complex::real/imag
- References: <509F0D27.email@example.com>
- Reply-to: libstdc++ at gcc dot gnu dot org
On Sat, 10 Nov 2012, Jason Merrill wrote:
As mentioned in http://gcc.gnu.org/wiki/Cxx11AbiCompatibility, C++11 changes
the return type of complex::real and imag, leading to a binary
incompatibility between C++98 and C++11 code if the functions are used
without inlining. This patch adds an ABI tag to the C++11 variants so that
they have different mangled names. This does not change the exports from
It looks like it won't prevent from using ref-qualifiers when they are
implemented if we want to (PR 51013), which is good.
For the map void->iterator change, I think it would make sense to just
unconditionally return an iterator;
It does break C++98 code that does "return f();" in a function returning
void, but that's negligible.
there's no binary compatibility issue
with older code that expects it to return void, the problem is only with
C++11 code calling a C++98 instantiation that returns void.
That's going to happen in practice, isn't it? So do you mean to add the
abi tag to this unified function, for safety?