This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] libstdc++/56785 reduce space overhead of nested tuples
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 17 Jan 2015 10:54:21 +0000
- Subject: Re: [patch] libstdc++/56785 reduce space overhead of nested tuples
- Authentication-results: sourceware.org; auth=none
- References: <20150117002350 dot GN3360 at redhat dot com> <alpine dot DEB dot 2 dot 11 dot 1501170936370 dot 1558 at laptop-mg dot saclay dot inria dot fr>
On 17 January 2015 at 08:49, Marc Glisse wrote:
> Hello,
>
> just checking that I understand how it works. std::tuple did not exist in
> C++03, so its ABI was not fixed, and you don't need to set abi_tag on it and
> on all the tuple users in libstdc++, which are also new in C++11.
Right. Anything depending on it must be recompiled anyway when moving
from a previous release to GCC 5.
The plan is to stop that requirement with GCC5, so that we declare the
types stable and it won't be necessary to recompile all C++11 code
when moving from 5 to a later release.
> What about std::rotate in a different patch though? As I understand it,
> changing the return type does not affect the mangling, and if we use the new
> function (and its return value) and link with older code that has the old
> function, if the linker picks the old function, bad things may happen, no?
That's true. We don't need an abi_tag (that's needed for classes as
they can be used as bases or members and alter the class layout
without affecting the mangled name) but the new definition of
std::rotate should be in the inline namespace _V2 that we've used for
a few other types, so the linker won't confuse it with the old version
returning void.