Skip to content

Commit 1607b93

Browse files
committed
Add _LIBCPP_ASSERT_INTERNAL
1 parent 33de0a1 commit 1607b93

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
@@ -555,6 +555,7 @@ vector<bool, _Allocator>::__recommend(size_type __new_size) const {
555555
template <class _Allocator>
556556
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
557557
vector<bool, _Allocator>::__construct_at_end(size_type __n, bool __x) {
558+
_LIBCPP_ASSERT_INTERNAL(__n > 0, "This function expects __n > 0");
558559
iterator __old_end = end();
559560
this->__size_ += __n;
560561
this->__begin_[(this->__size_ - 1) / __bits_per_word] = __storage_type(0);
@@ -565,6 +566,7 @@ template <class _Allocator>
565566
template <class _InputIterator, class _Sentinel>
566567
_LIBCPP_CONSTEXPR_SINCE_CXX20 void
567568
vector<bool, _Allocator>::__construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n) {
569+
_LIBCPP_ASSERT_INTERNAL(__n > 0, "This function expects __n > 0");
568570
iterator __old_end = end();
569571
this->__size_ += __n;
570572
this->__begin_[(this->__size_ - 1) / __bits_per_word] = __storage_type(0);

0 commit comments

Comments
 (0)