r243366 - in /branches/gcc-6-branch/libstdc++-v...
redi@gcc.gnu.org
redi@gcc.gnu.org
Wed Dec 7 15:59:00 GMT 2016
Author: redi
Date: Wed Dec 7 15:56:25 2016
New Revision: 243366
URL: https://gcc.gnu.org/viewcvs?rev=243366&root=gcc&view=rev
Log:
Fix std::experimental::shared_ptr SFINAE constraints
Backport from mainline
2016-10-19 Jonathan Wakely <jwakely@redhat.com>
* include/experimental/bits/shared_ptr.h
(__shared_ptr<__libfund_v1<_Tp, false>, _Lp>::_Compatible): Just use
is_convertible for non-array specialization.
(__shared_ptr<__libfund_v1<_Tp, false>, _Lp>::_UniqCompatible): New
constraint for conversions from unique_ptr.
(__shared_ptr<__libfund_v1<_Tp, false>, _Lp>::__shared_ptr): Constrain.
(__shared_ptr<__libfund_v1<_Tp, false>, _Lp>::reset): Likewise.
(__sp_compatible_v): New variable template for trait.
(__sp_is_constructible): New trait to check shared_ptr constraints.
(__sp_is_constructible_v): New variable template for trait.
(__shared_ptr<__libfund_v1<_Tp, true>, _Lp>::_SafeConv): New
constraint for construction/reset, using __sp_is_constructible_v.
(__shared_ptr<__libfund_v1<_Tp, true>, _Lp>::_UniqCompatible): New
constraint for conversions from unique_ptr.
(__shared_ptr<__libfund_v1<_Tp, true>, _Lp>::__shared_ptr): Constrain.
(__shared_ptr<__libfund_v1<_Tp, true>, _Lp>::reset): Likewise.
(shared_ptr::_SafeConv): Constraint for checking constructors.
(shared_ptr(Tp1*), shared_ptr(_Tp1, _Deleter))
(shared_ptr(_Tp1, _Deleter, _Alloc)): Constrain with _SafeConv.
(shared_ptr(const weak_ptr<_Tp1>&)): Constrain with _Compatible.
(shared_ptr(auto_ptr<_Tp1>&&)): Fix, remove TODO.
* testsuite/experimental/memory/shared_ptr/cons/pointer_ctor.cc:
Remove tests using invalid conversions.
* testsuite/experimental/memory/shared_ptr/cons/pointer_ctor_neg.cc:
New test.
* testsuite/experimental/memory/shared_ptr/cons/torture.cc: New test.
* testsuite/experimental/memory/shared_ptr/modifiers/reset.cc: Remove
tests using invalid conversions.
* testsuite/experimental/memory/shared_ptr/modifiers/reset_neg.cc: New
test.
* testsuite/experimental/memory/shared_ptr/observers/use_count.cc:
Remove tests using invalid conversions.
Added:
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/pointer_ctor_neg.cc
- copied, changed from r243365, branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/torture.cc
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory/shared_ptr/modifiers/reset_neg.cc
- copied, changed from r243365, branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc
Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/include/experimental/bits/shared_ptr.h
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/pointer_ctor.cc
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory/shared_ptr/modifiers/reset.cc
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory/shared_ptr/observers/use_count.cc
More information about the Gcc-cvs
mailing list