diff --git a/include/memory b/include/memory index f91262de9..d9dda72aa 100644 --- a/include/memory +++ b/include/memory @@ -794,7 +794,7 @@ struct _LIBCPP_VISIBLE pointer_traits typedef typename __pointer_traits_difference_type::type difference_type; #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - template using rebind = __pointer_traits_rebind::type; + template using rebind = typename __pointer_traits_rebind::type; #else template struct rebind {typedef typename __pointer_traits_rebind::type other;}; @@ -1331,7 +1331,7 @@ struct _LIBCPP_VISIBLE allocator_traits #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES template using rebind_alloc = - __allocator_traits_rebind::type; + typename __allocator_traits_rebind::type; template using rebind_traits = allocator_traits>; #else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES template struct rebind_alloc @@ -3338,7 +3338,7 @@ inline _LIBCPP_INLINE_VISIBILITY shared_ptr<_Tp>& shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r) { - shared_ptr(__r).swap(*this); + shared_ptr(_STD::move(__r)).swap(*this); return *this; } diff --git a/test/utilities/memory/default.allocator/allocator.members/construct.pass.cpp b/test/utilities/memory/default.allocator/allocator.members/construct.pass.cpp index 6b2d546df..7e1500b73 100644 --- a/test/utilities/memory/default.allocator/allocator.members/construct.pass.cpp +++ b/test/utilities/memory/default.allocator/allocator.members/construct.pass.cpp @@ -64,7 +64,7 @@ public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES move_only(move_only&&) {++move_only_constructed;} - move_only& operator=(move_only&&) {} + move_only& operator=(move_only&&) {return *this;} #else // _LIBCPP_HAS_NO_RVALUE_REFERENCES operator std::__rv () {return std::__rv(*this);} move_only(std::__rv) {++move_only_constructed;} diff --git a/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp b/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp index 1f54e6e38..21cdf4a13 100644 --- a/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp +++ b/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp @@ -47,7 +47,7 @@ int main() A* ptrA = pA.get(); { std::shared_ptr pB(new B); - pB = pA; + pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); @@ -64,7 +64,7 @@ int main() A* ptrA = pA.get(); { std::shared_ptr pB(new B); - pB = pA; + pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1); @@ -81,7 +81,7 @@ int main() A* ptrA = pA.get(); { std::shared_ptr pB; - pB = pA; + pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); @@ -98,7 +98,7 @@ int main() A* ptrA = pA.get(); { std::shared_ptr pB; - pB = pA; + pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1);