forked from OSchip/llvm-project
[libcxx] NFC. Correct wordings of _LIBCPP_ASSERT debug messages
Differential Revision: https://reviews.llvm.org/D102195
This commit is contained in:
parent
72e242a286
commit
96100f1508
|
@ -336,7 +336,7 @@ public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__hash_iterator& operator++() {
|
__hash_iterator& operator++() {
|
||||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||||
"Attempted to increment non-incrementable unordered container iterator");
|
"Attempted to increment a non-incrementable unordered container iterator");
|
||||||
__node_ = __node_->__next_;
|
__node_ = __node_->__next_;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,7 @@ public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__hash_const_iterator& operator++() {
|
__hash_const_iterator& operator++() {
|
||||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||||
"Attempted to increment non-incrementable unordered container const_iterator");
|
"Attempted to increment a non-incrementable unordered container const_iterator");
|
||||||
__node_ = __node_->__next_;
|
__node_ = __node_->__next_;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -569,7 +569,7 @@ public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__hash_local_iterator& operator++() {
|
__hash_local_iterator& operator++() {
|
||||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||||
"Attempted to increment non-incrementable unordered container local_iterator");
|
"Attempted to increment a non-incrementable unordered container local_iterator");
|
||||||
__node_ = __node_->__next_;
|
__node_ = __node_->__next_;
|
||||||
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
|
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
|
||||||
__node_ = nullptr;
|
__node_ = nullptr;
|
||||||
|
@ -714,7 +714,7 @@ public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__hash_const_local_iterator& operator++() {
|
__hash_const_local_iterator& operator++() {
|
||||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||||
"Attempted to increment non-incrementable unordered container const_local_iterator");
|
"Attempted to increment a non-incrementable unordered container const_local_iterator");
|
||||||
__node_ = __node_->__next_;
|
__node_ = __node_->__next_;
|
||||||
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
|
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
|
||||||
__node_ = nullptr;
|
__node_ = nullptr;
|
||||||
|
|
|
@ -2721,7 +2721,7 @@ template <class _Tp, class _Allocator>
|
||||||
void
|
void
|
||||||
deque<_Tp, _Allocator>::pop_back()
|
deque<_Tp, _Allocator>::pop_back()
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(!empty(), "deque::pop_back called for empty deque");
|
_LIBCPP_ASSERT(!empty(), "deque::pop_back called on an empty deque");
|
||||||
allocator_type& __a = __base::__alloc();
|
allocator_type& __a = __base::__alloc();
|
||||||
size_type __p = __base::size() + __base::__start_ - 1;
|
size_type __p = __base::size() + __base::__start_ - 1;
|
||||||
__alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
|
__alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
|
||||||
|
|
|
@ -1362,7 +1362,7 @@ public:
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||||
"Attempted to increment non-incrementable iterator");
|
"Attempted to increment a non-incrementable iterator");
|
||||||
#endif
|
#endif
|
||||||
++__i;
|
++__i;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -1374,7 +1374,7 @@ public:
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
||||||
"Attempted to decrement non-decrementable iterator");
|
"Attempted to decrement a non-decrementable iterator");
|
||||||
#endif
|
#endif
|
||||||
--__i;
|
--__i;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -1387,7 +1387,7 @@ public:
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
|
_LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
|
||||||
"Attempted to add/subtract iterator outside of valid range");
|
"Attempted to add/subtract an iterator outside its valid range");
|
||||||
#endif
|
#endif
|
||||||
__i += __n;
|
__i += __n;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -1400,7 +1400,7 @@ public:
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
|
_LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
|
||||||
"Attempted to subscript iterator outside of valid range");
|
"Attempted to subscript an iterator outside its valid range");
|
||||||
#endif
|
#endif
|
||||||
return __i[__n];
|
return __i[__n];
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,7 +377,7 @@ public:
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||||
"Attempted to increment non-incrementable list::iterator");
|
"Attempted to increment a non-incrementable list::iterator");
|
||||||
#endif
|
#endif
|
||||||
__ptr_ = __ptr_->__next_;
|
__ptr_ = __ptr_->__next_;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -390,7 +390,7 @@ public:
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
||||||
"Attempted to decrement non-decrementable list::iterator");
|
"Attempted to decrement a non-decrementable list::iterator");
|
||||||
#endif
|
#endif
|
||||||
__ptr_ = __ptr_->__prev_;
|
__ptr_ = __ptr_->__prev_;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -504,7 +504,7 @@ public:
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||||
"Attempted to increment non-incrementable list::const_iterator");
|
"Attempted to increment a non-incrementable list::const_iterator");
|
||||||
#endif
|
#endif
|
||||||
__ptr_ = __ptr_->__next_;
|
__ptr_ = __ptr_->__next_;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -517,7 +517,7 @@ public:
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
||||||
"Attempted to decrement non-decrementable list::const_iterator");
|
"Attempted to decrement a non-decrementable list::const_iterator");
|
||||||
#endif
|
#endif
|
||||||
__ptr_ = __ptr_->__prev_;
|
__ptr_ = __ptr_->__prev_;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -1772,7 +1772,7 @@ template <class _Tp, class _Alloc>
|
||||||
void
|
void
|
||||||
list<_Tp, _Alloc>::pop_back()
|
list<_Tp, _Alloc>::pop_back()
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(!empty(), "list::pop_back() called with empty list");
|
_LIBCPP_ASSERT(!empty(), "list::pop_back() called on an empty list");
|
||||||
__node_allocator& __na = base::__node_alloc();
|
__node_allocator& __na = base::__node_alloc();
|
||||||
__link_pointer __n = base::__end_.__prev_;
|
__link_pointer __n = base::__end_.__prev_;
|
||||||
base::__unlink_nodes(__n, __n);
|
base::__unlink_nodes(__n, __n);
|
||||||
|
@ -2049,14 +2049,14 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
||||||
"list::splice(iterator, list, iterator) called with first iterator not"
|
"list::splice(iterator, list, iterator) called with the first iterator"
|
||||||
" referring to this list");
|
" not referring to this list");
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__i) == &__c,
|
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__i) == &__c,
|
||||||
"list::splice(iterator, list, iterator) called with second iterator not"
|
"list::splice(iterator, list, iterator) called with the second iterator"
|
||||||
" referring to list argument");
|
" not referring to list argument");
|
||||||
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i),
|
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i),
|
||||||
"list::splice(iterator, list, iterator) called with second iterator not"
|
"list::splice(iterator, list, iterator) called with the second iterator"
|
||||||
" dereferenceable");
|
" not dereferenceable");
|
||||||
#endif
|
#endif
|
||||||
if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
|
if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
|
||||||
{
|
{
|
||||||
|
|
|
@ -878,7 +878,7 @@ public:
|
||||||
add_pointer_t<value_type const>
|
add_pointer_t<value_type const>
|
||||||
operator->() const
|
operator->() const
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
|
_LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
|
||||||
#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
|
#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
|
||||||
return _VSTD::addressof(this->__get());
|
return _VSTD::addressof(this->__get());
|
||||||
#else
|
#else
|
||||||
|
@ -891,7 +891,7 @@ public:
|
||||||
add_pointer_t<value_type>
|
add_pointer_t<value_type>
|
||||||
operator->()
|
operator->()
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
|
_LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
|
||||||
#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
|
#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
|
||||||
return _VSTD::addressof(this->__get());
|
return _VSTD::addressof(this->__get());
|
||||||
#else
|
#else
|
||||||
|
@ -904,7 +904,7 @@ public:
|
||||||
const value_type&
|
const value_type&
|
||||||
operator*() const&
|
operator*() const&
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
|
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
|
||||||
return this->__get();
|
return this->__get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -913,7 +913,7 @@ public:
|
||||||
value_type&
|
value_type&
|
||||||
operator*() &
|
operator*() &
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
|
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
|
||||||
return this->__get();
|
return this->__get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -922,7 +922,7 @@ public:
|
||||||
value_type&&
|
value_type&&
|
||||||
operator*() &&
|
operator*() &&
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
|
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
|
||||||
return _VSTD::move(this->__get());
|
return _VSTD::move(this->__get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -931,7 +931,7 @@ public:
|
||||||
const value_type&&
|
const value_type&&
|
||||||
operator*() const&&
|
operator*() const&&
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
|
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
|
||||||
return _VSTD::move(this->__get());
|
return _VSTD::move(this->__get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -674,22 +674,22 @@ public:
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY reference front() _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY reference front() _NOEXCEPT
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(!empty(), "front() called for empty vector");
|
_LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
|
||||||
return *this->__begin_;
|
return *this->__begin_;
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY const_reference front() const _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY const_reference front() const _NOEXCEPT
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(!empty(), "front() called for empty vector");
|
_LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
|
||||||
return *this->__begin_;
|
return *this->__begin_;
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY reference back() _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY reference back() _NOEXCEPT
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(!empty(), "back() called for empty vector");
|
_LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
|
||||||
return *(this->__end_ - 1);
|
return *(this->__end_ - 1);
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY const_reference back() const _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY const_reference back() const _NOEXCEPT
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(!empty(), "back() called for empty vector");
|
_LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
|
||||||
return *(this->__end_ - 1);
|
return *(this->__end_ - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1698,7 +1698,7 @@ inline
|
||||||
void
|
void
|
||||||
vector<_Tp, _Allocator>::pop_back()
|
vector<_Tp, _Allocator>::pop_back()
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(!empty(), "vector::pop_back called for empty vector");
|
_LIBCPP_ASSERT(!empty(), "vector::pop_back called on an empty vector");
|
||||||
this->__destruct_at_end(this->__end_ - 1);
|
this->__destruct_at_end(this->__end_ - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue