[libcxx] NFC. Correct wordings of _LIBCPP_ASSERT debug messages

Differential Revision: https://reviews.llvm.org/D102195
This commit is contained in:
Kristina Bessonova 2021-05-09 19:29:56 +02:00
parent 72e242a286
commit 96100f1508
6 changed files with 31 additions and 31 deletions

View File

@ -336,7 +336,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
__hash_iterator& operator++() {
_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_;
return *this;
}
@ -456,7 +456,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator& operator++() {
_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_;
return *this;
}
@ -569,7 +569,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
__hash_local_iterator& operator++() {
_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_;
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;
@ -714,7 +714,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
__hash_const_local_iterator& operator++() {
_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_;
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;

View File

@ -2721,7 +2721,7 @@ template <class _Tp, class _Allocator>
void
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();
size_type __p = __base::size() + __base::__start_ - 1;
__alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +

View File

@ -1362,7 +1362,7 @@ public:
{
#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to increment non-incrementable iterator");
"Attempted to increment a non-incrementable iterator");
#endif
++__i;
return *this;
@ -1374,7 +1374,7 @@ public:
{
#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
"Attempted to decrement non-decrementable iterator");
"Attempted to decrement a non-decrementable iterator");
#endif
--__i;
return *this;
@ -1387,7 +1387,7 @@ public:
{
#if _LIBCPP_DEBUG_LEVEL == 2
_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
__i += __n;
return *this;
@ -1400,7 +1400,7 @@ public:
{
#if _LIBCPP_DEBUG_LEVEL == 2
_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
return __i[__n];
}

View File

@ -377,7 +377,7 @@ public:
{
#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to increment non-incrementable list::iterator");
"Attempted to increment a non-incrementable list::iterator");
#endif
__ptr_ = __ptr_->__next_;
return *this;
@ -390,7 +390,7 @@ public:
{
#if _LIBCPP_DEBUG_LEVEL == 2
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
"Attempted to decrement non-decrementable list::iterator");
"Attempted to decrement a non-decrementable list::iterator");
#endif
__ptr_ = __ptr_->__prev_;
return *this;
@ -504,7 +504,7 @@ public:
{
#if _LIBCPP_DEBUG_LEVEL == 2
_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
__ptr_ = __ptr_->__next_;
return *this;
@ -517,7 +517,7 @@ public:
{
#if _LIBCPP_DEBUG_LEVEL == 2
_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
__ptr_ = __ptr_->__prev_;
return *this;
@ -1772,7 +1772,7 @@ template <class _Tp, class _Alloc>
void
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();
__link_pointer __n = base::__end_.__prev_;
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
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"list::splice(iterator, list, iterator) called with first iterator not"
" referring to this list");
"list::splice(iterator, list, iterator) called with the first iterator"
" not referring to this list");
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__i) == &__c,
"list::splice(iterator, list, iterator) called with second iterator not"
" referring to list argument");
"list::splice(iterator, list, iterator) called with the second iterator"
" not referring to list argument");
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i),
"list::splice(iterator, list, iterator) called with second iterator not"
" dereferenceable");
"list::splice(iterator, list, iterator) called with the second iterator"
" not dereferenceable");
#endif
if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
{

View File

@ -878,7 +878,7 @@ public:
add_pointer_t<value_type 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
return _VSTD::addressof(this->__get());
#else
@ -891,7 +891,7 @@ public:
add_pointer_t<value_type>
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
return _VSTD::addressof(this->__get());
#else
@ -904,7 +904,7 @@ public:
const value_type&
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();
}
@ -913,7 +913,7 @@ public:
value_type&
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();
}
@ -922,7 +922,7 @@ public:
value_type&&
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());
}
@ -931,7 +931,7 @@ public:
const value_type&&
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());
}

View File

@ -674,22 +674,22 @@ public:
_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_;
}
_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_;
}
_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);
}
_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);
}
@ -1698,7 +1698,7 @@ inline
void
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);
}