Skip to content

Commit 1b65294

Browse files
committed
Add _LIBCPP_ASSERT_INTERNAL
1 parent e9ffbc8 commit 1b65294

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libcxx/include/__vector/vector_bool.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ vector<bool, _Allocator>::__recommend(size_type __new_size) const {
558558
template <class _Allocator>
559559
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
560560
vector<bool, _Allocator>::__construct_at_end(size_type __n, bool __x) {
561+
_LIBCPP_ASSERT_INTERNAL(__n > 0, "This function expects __n > 0");
561562
iterator __old_end = end();
562563
this->__size_ += __n;
563564
this->__begin_[(this->__size_ - 1) / __bits_per_word] = __storage_type(0);
@@ -568,6 +569,7 @@ template <class _Allocator>
568569
template <class _InputIterator, class _Sentinel>
569570
_LIBCPP_CONSTEXPR_SINCE_CXX20 void
570571
vector<bool, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n) {
572+
_LIBCPP_ASSERT_INTERNAL(__n > 0, "This function expects __n > 0");
571573
iterator __old_end = end();
572574
this->__size_ += __n;
573575
this->__begin_[(this->__size_ - 1) / __bits_per_word] = __storage_type(0);

0 commit comments

Comments
 (0)