This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] PR libstdc++/86751 default assignment operators for std::pair
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 31 Jul 2018 20:14:49 +0300
- Subject: Re: [PATCH] PR libstdc++/86751 default assignment operators for std::pair
- References: <20180731170737.GA23260@redhat.com>
On 31 July 2018 at 20:07, Jonathan Wakely <jwakely@redhat.com> wrote:
> The solution for PR 77537 causes ambiguities due to the extra copy
> assignment operator taking a __nonesuch_no_braces parameter. The copy
> and move assignment operators can be defined as defaulted to meet the
> semantics required by the standard.
>
> In order to preserve ABI compatibility (specifically argument passing
> conventions for pair<T, T>) we need a new base class that makes the
> assignment operators non-trivial.
>
> PR libstdc++/86751
> * include/bits/stl_pair.h (__nonesuch_no_braces): Remove.
> (__pair_base): New class with non-trivial copy assignment operator.
> (pair): Derive from __pair_base. Define copy assignment and move
> assignment operators as defaulted.
> * testsuite/20_util/pair/86751.cc: New test.
>
>
> Ville, this passes all our tests, but am I forgetting something that
> means this isn't right?
Pairs of references?