[Bug libstdc++/56785] std::tuple of two elements does not apply empty base class optimization when one of its elements is a std::tuple with two elements

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 16 22:28:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56785

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The cause is that every N-tuple hierarchy ends with an empty _Tuple_impl<N>
base, so when there are several of those in the same hierarchy they need to
have separate addresses.

It should be possible to fix by eliminating that terminal objet in the
inheritance hierarchy. The obvious way duplicates a chunk of code, I think it
should be possible to do it in a nicer way, which I'm experimenting with.



More information about the Gcc-bugs mailing list