Fix const correctness bug in __move_assign. Found and fixed by Ion Gaztañaga.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@139032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6b171c557b
commit
9cbee430da
@ -141,14 +141,14 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const __split_buffer& __c, true_type)
|
void __move_assign_alloc(__split_buffer& __c, true_type)
|
||||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||||
{
|
{
|
||||||
__alloc() = _VSTD::move(__c.__alloc());
|
__alloc() = _VSTD::move(__c.__alloc());
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const __split_buffer& __c, false_type) _NOEXCEPT
|
void __move_assign_alloc(__split_buffer& __c, false_type) _NOEXCEPT
|
||||||
{}
|
{}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
@ -977,14 +977,14 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const __deque_base& __c, true_type)
|
void __move_assign_alloc(__deque_base& __c, true_type)
|
||||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||||
{
|
{
|
||||||
__alloc() = _VSTD::move(__c.__alloc());
|
__alloc() = _VSTD::move(__c.__alloc());
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const __deque_base& __c, false_type) _NOEXCEPT
|
void __move_assign_alloc(__deque_base& __c, false_type) _NOEXCEPT
|
||||||
{}
|
{}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
@ -444,14 +444,14 @@ private:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const __list_imp& __c, true_type)
|
void __move_assign_alloc(__list_imp& __c, true_type)
|
||||||
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
||||||
{
|
{
|
||||||
__node_alloc() = _VSTD::move(__c.__node_alloc());
|
__node_alloc() = _VSTD::move(__c.__node_alloc());
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const __list_imp& __c, false_type)
|
void __move_assign_alloc(__list_imp& __c, false_type)
|
||||||
_NOEXCEPT
|
_NOEXCEPT
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
@ -1593,7 +1593,7 @@ private:
|
|||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
__move_assign_alloc(const basic_string& __str)
|
__move_assign_alloc(basic_string& __str)
|
||||||
_NOEXCEPT_(
|
_NOEXCEPT_(
|
||||||
!__alloc_traits::propagate_on_container_move_assignment::value ||
|
!__alloc_traits::propagate_on_container_move_assignment::value ||
|
||||||
is_nothrow_move_assignable<allocator_type>::value)
|
is_nothrow_move_assignable<allocator_type>::value)
|
||||||
@ -1601,14 +1601,14 @@ private:
|
|||||||
__alloc_traits::propagate_on_container_move_assignment::value>());}
|
__alloc_traits::propagate_on_container_move_assignment::value>());}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const basic_string& __c, true_type)
|
void __move_assign_alloc(basic_string& __c, true_type)
|
||||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||||
{
|
{
|
||||||
__alloc() = _VSTD::move(__c.__alloc());
|
__alloc() = _VSTD::move(__c.__alloc());
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const basic_string& __c, false_type)
|
void __move_assign_alloc(basic_string& __c, false_type)
|
||||||
_NOEXCEPT
|
_NOEXCEPT
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ public:
|
|||||||
|
|
||||||
vector()
|
vector()
|
||||||
noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
||||||
explicit vector(const allocator_type& = allocator_type());
|
explicit vector(const allocator_type&);
|
||||||
explicit vector(size_type n, const value_type& value = value_type(), const allocator_type& = allocator_type());
|
explicit vector(size_type n, const value_type& value = value_type(), const allocator_type& = allocator_type());
|
||||||
template <class InputIterator>
|
template <class InputIterator>
|
||||||
vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());
|
vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());
|
||||||
@ -402,14 +402,14 @@ private:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const __vector_base& __c, true_type)
|
void __move_assign_alloc(__vector_base& __c, true_type)
|
||||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||||
{
|
{
|
||||||
__alloc() = _VSTD::move(__c.__alloc());
|
__alloc() = _VSTD::move(__c.__alloc());
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const __vector_base& __c, false_type)
|
void __move_assign_alloc(__vector_base& __c, false_type)
|
||||||
_NOEXCEPT
|
_NOEXCEPT
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -2087,14 +2087,14 @@ private:
|
|||||||
{__move_assign_alloc(__c, integral_constant<bool,
|
{__move_assign_alloc(__c, integral_constant<bool,
|
||||||
__storage_traits::propagate_on_container_move_assignment::value>());}
|
__storage_traits::propagate_on_container_move_assignment::value>());}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const vector& __c, true_type)
|
void __move_assign_alloc(vector& __c, true_type)
|
||||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||||
{
|
{
|
||||||
__alloc() = _VSTD::move(__c.__alloc());
|
__alloc() = _VSTD::move(__c.__alloc());
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __move_assign_alloc(const vector& __c, false_type)
|
void __move_assign_alloc(vector& __c, false_type)
|
||||||
_NOEXCEPT
|
_NOEXCEPT
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user