Skip to content

Commit 96100f1

Browse files
committed
[libcxx] NFC. Correct wordings of _LIBCPP_ASSERT debug messages
Differential Revision: https://reviews.llvm.org/D102195
1 parent 72e242a commit 96100f1

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

libcxx/include/__hash_table

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public:
336336
_LIBCPP_INLINE_VISIBILITY
337337
__hash_iterator& operator++() {
338338
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
339-
"Attempted to increment non-incrementable unordered container iterator");
339+
"Attempted to increment a non-incrementable unordered container iterator");
340340
__node_ = __node_->__next_;
341341
return *this;
342342
}
@@ -456,7 +456,7 @@ public:
456456
_LIBCPP_INLINE_VISIBILITY
457457
__hash_const_iterator& operator++() {
458458
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
459-
"Attempted to increment non-incrementable unordered container const_iterator");
459+
"Attempted to increment a non-incrementable unordered container const_iterator");
460460
__node_ = __node_->__next_;
461461
return *this;
462462
}
@@ -569,7 +569,7 @@ public:
569569
_LIBCPP_INLINE_VISIBILITY
570570
__hash_local_iterator& operator++() {
571571
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
572-
"Attempted to increment non-incrementable unordered container local_iterator");
572+
"Attempted to increment a non-incrementable unordered container local_iterator");
573573
__node_ = __node_->__next_;
574574
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
575575
__node_ = nullptr;
@@ -714,7 +714,7 @@ public:
714714
_LIBCPP_INLINE_VISIBILITY
715715
__hash_const_local_iterator& operator++() {
716716
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
717-
"Attempted to increment non-incrementable unordered container const_local_iterator");
717+
"Attempted to increment a non-incrementable unordered container const_local_iterator");
718718
__node_ = __node_->__next_;
719719
if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
720720
__node_ = nullptr;

libcxx/include/deque

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2721,7 +2721,7 @@ template <class _Tp, class _Allocator>
27212721
void
27222722
deque<_Tp, _Allocator>::pop_back()
27232723
{
2724-
_LIBCPP_ASSERT(!empty(), "deque::pop_back called for empty deque");
2724+
_LIBCPP_ASSERT(!empty(), "deque::pop_back called on an empty deque");
27252725
allocator_type& __a = __base::__alloc();
27262726
size_type __p = __base::size() + __base::__start_ - 1;
27272727
__alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +

libcxx/include/iterator

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ public:
13621362
{
13631363
#if _LIBCPP_DEBUG_LEVEL == 2
13641364
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
1365-
"Attempted to increment non-incrementable iterator");
1365+
"Attempted to increment a non-incrementable iterator");
13661366
#endif
13671367
++__i;
13681368
return *this;
@@ -1374,7 +1374,7 @@ public:
13741374
{
13751375
#if _LIBCPP_DEBUG_LEVEL == 2
13761376
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
1377-
"Attempted to decrement non-decrementable iterator");
1377+
"Attempted to decrement a non-decrementable iterator");
13781378
#endif
13791379
--__i;
13801380
return *this;
@@ -1387,7 +1387,7 @@ public:
13871387
{
13881388
#if _LIBCPP_DEBUG_LEVEL == 2
13891389
_LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
1390-
"Attempted to add/subtract iterator outside of valid range");
1390+
"Attempted to add/subtract an iterator outside its valid range");
13911391
#endif
13921392
__i += __n;
13931393
return *this;
@@ -1400,7 +1400,7 @@ public:
14001400
{
14011401
#if _LIBCPP_DEBUG_LEVEL == 2
14021402
_LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
1403-
"Attempted to subscript iterator outside of valid range");
1403+
"Attempted to subscript an iterator outside its valid range");
14041404
#endif
14051405
return __i[__n];
14061406
}

libcxx/include/list

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public:
377377
{
378378
#if _LIBCPP_DEBUG_LEVEL == 2
379379
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
380-
"Attempted to increment non-incrementable list::iterator");
380+
"Attempted to increment a non-incrementable list::iterator");
381381
#endif
382382
__ptr_ = __ptr_->__next_;
383383
return *this;
@@ -390,7 +390,7 @@ public:
390390
{
391391
#if _LIBCPP_DEBUG_LEVEL == 2
392392
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
393-
"Attempted to decrement non-decrementable list::iterator");
393+
"Attempted to decrement a non-decrementable list::iterator");
394394
#endif
395395
__ptr_ = __ptr_->__prev_;
396396
return *this;
@@ -504,7 +504,7 @@ public:
504504
{
505505
#if _LIBCPP_DEBUG_LEVEL == 2
506506
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
507-
"Attempted to increment non-incrementable list::const_iterator");
507+
"Attempted to increment a non-incrementable list::const_iterator");
508508
#endif
509509
__ptr_ = __ptr_->__next_;
510510
return *this;
@@ -517,7 +517,7 @@ public:
517517
{
518518
#if _LIBCPP_DEBUG_LEVEL == 2
519519
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
520-
"Attempted to decrement non-decrementable list::const_iterator");
520+
"Attempted to decrement a non-decrementable list::const_iterator");
521521
#endif
522522
__ptr_ = __ptr_->__prev_;
523523
return *this;
@@ -1772,7 +1772,7 @@ template <class _Tp, class _Alloc>
17721772
void
17731773
list<_Tp, _Alloc>::pop_back()
17741774
{
1775-
_LIBCPP_ASSERT(!empty(), "list::pop_back() called with empty list");
1775+
_LIBCPP_ASSERT(!empty(), "list::pop_back() called on an empty list");
17761776
__node_allocator& __na = base::__node_alloc();
17771777
__link_pointer __n = base::__end_.__prev_;
17781778
base::__unlink_nodes(__n, __n);
@@ -2049,14 +2049,14 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
20492049
{
20502050
#if _LIBCPP_DEBUG_LEVEL == 2
20512051
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
2052-
"list::splice(iterator, list, iterator) called with first iterator not"
2053-
" referring to this list");
2052+
"list::splice(iterator, list, iterator) called with the first iterator"
2053+
" not referring to this list");
20542054
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__i) == &__c,
2055-
"list::splice(iterator, list, iterator) called with second iterator not"
2056-
" referring to list argument");
2055+
"list::splice(iterator, list, iterator) called with the second iterator"
2056+
" not referring to list argument");
20572057
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i),
2058-
"list::splice(iterator, list, iterator) called with second iterator not"
2059-
" dereferenceable");
2058+
"list::splice(iterator, list, iterator) called with the second iterator"
2059+
" not dereferenceable");
20602060
#endif
20612061
if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
20622062
{

libcxx/include/optional

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ public:
878878
add_pointer_t<value_type const>
879879
operator->() const
880880
{
881-
_LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
881+
_LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
882882
#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
883883
return _VSTD::addressof(this->__get());
884884
#else
@@ -891,7 +891,7 @@ public:
891891
add_pointer_t<value_type>
892892
operator->()
893893
{
894-
_LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
894+
_LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
895895
#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
896896
return _VSTD::addressof(this->__get());
897897
#else
@@ -904,7 +904,7 @@ public:
904904
const value_type&
905905
operator*() const&
906906
{
907-
_LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
907+
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
908908
return this->__get();
909909
}
910910

@@ -913,7 +913,7 @@ public:
913913
value_type&
914914
operator*() &
915915
{
916-
_LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
916+
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
917917
return this->__get();
918918
}
919919

@@ -922,7 +922,7 @@ public:
922922
value_type&&
923923
operator*() &&
924924
{
925-
_LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
925+
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
926926
return _VSTD::move(this->__get());
927927
}
928928

@@ -931,7 +931,7 @@ public:
931931
const value_type&&
932932
operator*() const&&
933933
{
934-
_LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
934+
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
935935
return _VSTD::move(this->__get());
936936
}
937937

libcxx/include/vector

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -674,22 +674,22 @@ public:
674674

675675
_LIBCPP_INLINE_VISIBILITY reference front() _NOEXCEPT
676676
{
677-
_LIBCPP_ASSERT(!empty(), "front() called for empty vector");
677+
_LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
678678
return *this->__begin_;
679679
}
680680
_LIBCPP_INLINE_VISIBILITY const_reference front() const _NOEXCEPT
681681
{
682-
_LIBCPP_ASSERT(!empty(), "front() called for empty vector");
682+
_LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
683683
return *this->__begin_;
684684
}
685685
_LIBCPP_INLINE_VISIBILITY reference back() _NOEXCEPT
686686
{
687-
_LIBCPP_ASSERT(!empty(), "back() called for empty vector");
687+
_LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
688688
return *(this->__end_ - 1);
689689
}
690690
_LIBCPP_INLINE_VISIBILITY const_reference back() const _NOEXCEPT
691691
{
692-
_LIBCPP_ASSERT(!empty(), "back() called for empty vector");
692+
_LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
693693
return *(this->__end_ - 1);
694694
}
695695

@@ -1698,7 +1698,7 @@ inline
16981698
void
16991699
vector<_Tp, _Allocator>::pop_back()
17001700
{
1701-
_LIBCPP_ASSERT(!empty(), "vector::pop_back called for empty vector");
1701+
_LIBCPP_ASSERT(!empty(), "vector::pop_back called on an empty vector");
17021702
this->__destruct_at_end(this->__end_ - 1);
17031703
}
17041704

0 commit comments

Comments
 (0)