PR libstdc++/86963 Implement LWG 2729 constraints on tuple assignment
commit023f288a76f568b8cb70a764ed199ccb1599e6e9
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Aug 2018 17:52:49 +0000 (17 17:52 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Aug 2018 17:52:49 +0000 (17 17:52 +0000)
tree832430bb0a15d9fa69ca293fd004bf9c53bb98e8
parentec5d521d5e2e76be18edd5bd7dd680f5a9d762b3
PR libstdc++/86963 Implement LWG 2729 constraints on tuple assignment

PR libstdc++/86963
* include/std/tuple (__tuple_base): New class template with deleted
copy assignment operator.
(tuple, tuple<_T1, _T2>): Derive from __tuple_base<tuple> so that
implicit copy/move assignment operator will be deleted/suppressed.
(tuple::__assignable, tuple<_T1, _T2>::__assignable): New helper
functions for SFINAE constraints on assignment operators.
(tuple::__nothrow_assignable, tuple<_T1, _T2>::__nothrow_assignable):
New helper functions for exception specifications.
(tuple::operator=(const tuple&), tuple::operator=(tuple&&))
(tuple<_T1, _T2>::operator=(const tuple&))
(tuple<_T1, _T2>::operator=(tuple&&)): Change parameter types to
__nonesuch_no_braces when the operator should be defined implicitly.
Use __nothrow_assignable for exception specifications.
(tuple::operator=(const tuple<_UElements...>&))
(tuple::operator=(tuple<_UElements...>&&))
(tuple<_T1, _T2>::operator=(const tuple<_U1, _U2>&))
(tuple<_T1, _T2>::operator=(tuple<_U1, _U2>&&))
(tuple<_T1, _T2>::operator=(const pair<_U1, _U2>&))
(tuple<_T1, _T2>::operator=(pair<_U1, _U2>&&)): Constrain using
__assignable and use __nothrow_assignable for exception
specifications.
* python/libstdcxx/v6/printers.py (is_specialization_of): Accept
gdb.Type as first argument, instead of a string.
(StdTuplePrinter._iterator._is_nonempty_tuple): New method to check
tuple for expected structure.
(StdTuplePrinter._iterator.__init__): Use _is_nonempty_tuple.
* testsuite/20_util/tuple/dr2729.cc: New test.
* testsuite/20_util/tuple/element_access/get_neg.cc: Change dg-error
to dg-prune-output.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263625 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/tuple
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/20_util/tuple/dr2729.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/tuple/element_access/get_neg.cc