This is the mail archive of the gcc-patches@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]

[v3] fix PR 53648


Using the empty base-class optimization in std::tuple can result in
ambiguous base classes when you have a tuple of tuples. This patch
disables the EBO for tuple elements that are themselves tuples, with
tuple_size > 1 (because for a zero-size tuple the base class will be
_Tuple_impl<1> and the tuple that contains it must have _Tuple_impl<N>
where N>1, because it contains at least one element, the zero-sized
tuple).

        PR libstdc++/53648
        * include/std/tuple (__empty_not_final): Do not use EBO for tuples.
        * testsuite/20_util/tuple/53648.cc: New.
        * testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error line
        number.

Tested x86_64-linux, committed to trunk.  Although I think it would be
safe I have no plans to apply it to release branches.

Attachment: patch.txt
Description: Text document


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