[Bug libstdc++/86751] [6/7/8/9 Regression] Ambiguous operator= overload for std::pair

2018-07-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86751

--- Comment #2 from Jonathan Wakely  ---
Author: redi
Date: Tue Jul 31 22:31:20 2018
New Revision: 263185

URL: https://gcc.gnu.org/viewcvs?rev=263185=gcc=rev
Log:
PR libstdc++/86751 default assignment operators for std::pair

The solution for PR 77537 causes ambiguities due to the extra copy
assignment operator taking a __nonesuch_no_braces parameter. By making
the base class non-assignable we don't need the extra deleted overload
in std::pair. The copy assignment operator will be implicitly deleted
(and the move assignment operator not declared) as needed. Without the
additional user-provided operator in std::pair the ambiguity is avoided.

PR libstdc++/86751
* include/bits/stl_pair.h (__pair_base): New class with deleted copy
assignment operator.
(pair): Derive from __pair_base.
(pair::operator=): Remove deleted overload.
* python/libstdcxx/v6/printers.py (StdPairPrinter): New pretty printer
so that new base class isn't shown in GDB.
* testsuite/20_util/pair/86751.cc: New test.
* testsuite/20_util/pair/ref_assign.cc: New test.

Added:
trunk/libstdc++-v3/testsuite/20_util/pair/86751.cc
trunk/libstdc++-v3/testsuite/20_util/pair/ref_assign.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/stl_pair.h
trunk/libstdc++-v3/python/libstdcxx/v6/printers.py

[Bug libstdc++/86751] [6/7/8/9 Regression] Ambiguous operator= overload for std::pair

2018-07-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86751

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-07-31
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
Summary|Ambiguous operator= |[6/7/8/9 Regression]
   |overload for std::pair |overload for std::pair
 Ever confirmed|0   |1
  Known to fail||9.0

--- Comment #1 from Jonathan Wakely  ---
Confirmed. Seems easier to fix than I expected it to be ...