PR libstdc++/86751 default assignment operators for std::pair
commit785c6c31ab5b3ebf42ae1644a7f9b4f893fe79d2
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jul 2018 22:31:20 +0000 (31 22:31 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jul 2018 22:31:20 +0000 (31 22:31 +0000)
treed7eb7ca6f086116d8255266c60687c914c552802
parent3ee8fe55e047ff62265c1b850b78da15d06a208f
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263185 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_pair.h
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/20_util/pair/86751.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/pair/ref_assign.cc [new file with mode: 0644]