Skip to content

Commit ca0c852

Browse files
Fix whitespace, add a couple of tests for [[clang::lifetimebound]] annotations in libc++, and avoid erroring on lifetimebound warnings in libcxx test code
1 parent b0eeafe commit ca0c852

File tree

26 files changed

+380
-137
lines changed

26 files changed

+380
-137
lines changed

libcxx/include/__chrono/tzdb_list.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@ class _LIBCPP_AVAILABILITY_TZDB tzdb_list {
5555

5656
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const tzdb& front() const noexcept _LIBCPP_LIFETIMEBOUND { return __front(); }
5757

58-
_LIBCPP_HIDE_FROM_ABI const_iterator erase_after(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __erase_after(__p); }
58+
_LIBCPP_HIDE_FROM_ABI const_iterator erase_after(const_iterator __p) _LIBCPP_LIFETIMEBOUND {
59+
return __erase_after(__p);
60+
}
5961

6062
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND { return __begin(); }
6163
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND { return __end(); }
6264

63-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND { return __cbegin(); }
65+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND {
66+
return __cbegin();
67+
}
6468
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept _LIBCPP_LIFETIMEBOUND { return __cend(); }
6569

6670
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI __impl& __implementation() { return *__impl_; }

libcxx/include/__expected/expected.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,8 @@ class expected : private __expected_base<_Tp, _Err> {
722722

723723
template <class _Up, class... _Args>
724724
requires is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, _Args...>
725-
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) noexcept _LIBCPP_LIFETIMEBOUND {
725+
_LIBCPP_HIDE_FROM_ABI constexpr _Tp&
726+
emplace(initializer_list<_Up> __il, _Args&&... __args) noexcept _LIBCPP_LIFETIMEBOUND {
726727
this->__destroy();
727728
this->__construct(in_place, __il, std::forward<_Args>(__args)...);
728729
return this->__val();

libcxx/include/__mdspan/extents.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ template <class _Tp, size_t _Size>
7979
struct __possibly_empty_array {
8080
_Tp __vals_[_Size];
8181
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator[](size_t __index) _LIBCPP_LIFETIMEBOUND { return __vals_[__index]; }
82-
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __index) const _LIBCPP_LIFETIMEBOUND { return __vals_[__index]; }
82+
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __index) const _LIBCPP_LIFETIMEBOUND {
83+
return __vals_[__index];
84+
}
8385
};
8486

8587
template <class _Tp>

libcxx/include/__memory/unique_ptr.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
275275
return *__ptr_;
276276
}
277277
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer operator->() const _NOEXCEPT { return __ptr_; }
278-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __ptr_; }
278+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
279+
return __ptr_;
280+
}
279281
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 deleter_type& get_deleter() _NOEXCEPT { return __deleter_; }
280282
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 const deleter_type& get_deleter() const _NOEXCEPT {
281283
return __deleter_;
@@ -585,7 +587,9 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
585587
"unique_ptr<T[]>::operator[](index): index out of range");
586588
return __ptr_[__i];
587589
}
588-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __ptr_; }
590+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
591+
return __ptr_;
592+
}
589593

590594
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 deleter_type& get_deleter() _NOEXCEPT { return __deleter_; }
591595

libcxx/include/__node_handle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ template <class _NodeType, class _Derived>
170170
struct __set_node_handle_specifics {
171171
typedef typename _NodeType::__node_value_type value_type;
172172

173-
_LIBCPP_HIDE_FROM_ABI value_type& value() const _LIBCPP_LIFETIMEBOUND { return static_cast<_Derived const*>(this)->__ptr_->__get_value(); }
173+
_LIBCPP_HIDE_FROM_ABI value_type& value() const _LIBCPP_LIFETIMEBOUND {
174+
return static_cast<_Derived const*>(this)->__ptr_->__get_value();
175+
}
174176
};
175177

176178
template <class _NodeType, class _Derived>

libcxx/include/__split_buffer

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,17 @@ public:
114114
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer& __end_cap() _NOEXCEPT { return __end_cap_; }
115115
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const pointer& __end_cap() const _NOEXCEPT { return __end_cap_; }
116116

117-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __begin_; }
118-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __begin_; }
117+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
118+
return __begin_;
119+
}
120+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
121+
return __begin_;
122+
}
119123

120124
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __end_; }
121-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __end_; }
125+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
126+
return __end_;
127+
}
122128

123129
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __destruct_at_end(__begin_); }
124130

@@ -141,9 +147,13 @@ public:
141147
}
142148

143149
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _LIBCPP_LIFETIMEBOUND { return *__begin_; }
144-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _LIBCPP_LIFETIMEBOUND { return *__begin_; }
150+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _LIBCPP_LIFETIMEBOUND {
151+
return *__begin_;
152+
}
145153
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _LIBCPP_LIFETIMEBOUND { return *(__end_ - 1); }
146-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _LIBCPP_LIFETIMEBOUND { return *(__end_ - 1); }
154+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _LIBCPP_LIFETIMEBOUND {
155+
return *(__end_ - 1);
156+
}
147157

148158
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
149159
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;

libcxx/include/__thread/thread.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ class __thread_specific_ptr {
8282
__thread_specific_ptr& operator=(const __thread_specific_ptr&) = delete;
8383
~__thread_specific_ptr();
8484

85-
_LIBCPP_HIDE_FROM_ABI pointer get() const _LIBCPP_LIFETIMEBOUND { return static_cast<_Tp*>(__libcpp_tls_get(__key_)); }
85+
_LIBCPP_HIDE_FROM_ABI pointer get() const _LIBCPP_LIFETIMEBOUND {
86+
return static_cast<_Tp*>(__libcpp_tls_get(__key_));
87+
}
8688
_LIBCPP_HIDE_FROM_ABI pointer operator*() const { return *get(); }
8789
_LIBCPP_HIDE_FROM_ABI pointer operator->() const { return get(); }
8890
void set_pointer(pointer __p);

libcxx/include/__tree

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,9 @@ private:
962962
public:
963963
_LIBCPP_HIDE_FROM_ABI const size_type& size() const _NOEXCEPT { return __size_; }
964964
_LIBCPP_HIDE_FROM_ABI value_compare& value_comp() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __value_comp_; }
965-
_LIBCPP_HIDE_FROM_ABI const value_compare& value_comp() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __value_comp_; }
965+
_LIBCPP_HIDE_FROM_ABI const value_compare& value_comp() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
966+
return __value_comp_;
967+
}
966968

967969
public:
968970
_LIBCPP_HIDE_FROM_ABI __node_pointer __root() const _NOEXCEPT {
@@ -995,9 +997,13 @@ public:
995997
_LIBCPP_HIDE_FROM_ABI ~__tree();
996998

997999
_LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(__begin_node()); }
998-
_LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(__begin_node()); }
1000+
_LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
1001+
return const_iterator(__begin_node());
1002+
}
9991003
_LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(__end_node()); }
1000-
_LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(__end_node()); }
1004+
_LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
1005+
return const_iterator(__end_node());
1006+
}
10011007

10021008
_LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
10031009
return std::min<size_type>(__node_traits::max_size(__node_alloc()), numeric_limits<difference_type >::max());

libcxx/include/__vector/vector.h

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,12 @@ class _LIBCPP_TEMPLATE_VIS vector {
317317
return const_reverse_iterator(begin());
318318
}
319319

320-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
321-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
320+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
321+
return begin();
322+
}
323+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
324+
return end();
325+
}
322326
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT {
323327
return rbegin();
324328
}
@@ -337,8 +341,10 @@ class _LIBCPP_TEMPLATE_VIS vector {
337341
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
338342
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
339343

340-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __n) _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
341-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __n) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
344+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference
345+
operator[](size_type __n) _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
346+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference
347+
operator[](size_type __n) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
342348
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference at(size_type __n) _LIBCPP_LIFETIMEBOUND;
343349
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const _LIBCPP_LIFETIMEBOUND;
344350

@@ -390,11 +396,14 @@ class _LIBCPP_TEMPLATE_VIS vector {
390396

391397
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back();
392398

393-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, const_reference __x) _LIBCPP_LIFETIMEBOUND;
399+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, const_reference __x)
400+
_LIBCPP_LIFETIMEBOUND;
394401

395-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, value_type&& __x) _LIBCPP_LIFETIMEBOUND;
402+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, value_type&& __x)
403+
_LIBCPP_LIFETIMEBOUND;
396404
template <class... _Args>
397-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __position, _Args&&... __args) _LIBCPP_LIFETIMEBOUND;
405+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __position, _Args&&... __args)
406+
_LIBCPP_LIFETIMEBOUND;
398407

399408
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
400409
insert(const_iterator __position, size_type __n, const_reference __x) _LIBCPP_LIFETIMEBOUND;
@@ -408,7 +417,8 @@ class _LIBCPP_TEMPLATE_VIS vector {
408417

409418
#if _LIBCPP_STD_VER >= 23
410419
template <_ContainerCompatibleRange<_Tp> _Range>
411-
_LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
420+
_LIBCPP_HIDE_FROM_ABI constexpr iterator
421+
insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
412422
if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
413423
auto __n = static_cast<size_type>(ranges::distance(__range));
414424
return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
@@ -435,7 +445,8 @@ class _LIBCPP_TEMPLATE_VIS vector {
435445
#endif
436446

437447
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __position) _LIBCPP_LIFETIMEBOUND;
438-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND;
448+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last)
449+
_LIBCPP_LIFETIMEBOUND;
439450

440451
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {
441452
size_type __old_size = size();

libcxx/include/__vector/vector_bool.h

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,15 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
254254
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void reserve(size_type __n);
255255
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void shrink_to_fit() _NOEXCEPT;
256256

257-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __make_iter(0); }
258-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __make_iter(0); }
259-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __make_iter(__size_); }
257+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
258+
return __make_iter(0);
259+
}
260+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
261+
return __make_iter(0);
262+
}
263+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
264+
return __make_iter(__size_);
265+
}
260266
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
261267
return __make_iter(__size_);
262268
}
@@ -274,7 +280,9 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
274280
return const_reverse_iterator(begin());
275281
}
276282

277-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __make_iter(0); }
283+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
284+
return __make_iter(0);
285+
}
278286
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
279287
return __make_iter(__size_);
280288
}
@@ -283,17 +291,26 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
283291
}
284292
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
285293

286-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __n) _LIBCPP_LIFETIMEBOUND { return __make_ref(__n); }
287-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __n) const _LIBCPP_LIFETIMEBOUND {
294+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __n) _LIBCPP_LIFETIMEBOUND {
295+
return __make_ref(__n);
296+
}
297+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference
298+
operator[](size_type __n) const _LIBCPP_LIFETIMEBOUND {
288299
return __make_ref(__n);
289300
}
290301
_LIBCPP_HIDE_FROM_ABI reference at(size_type __n) _LIBCPP_LIFETIMEBOUND;
291302
_LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const _LIBCPP_LIFETIMEBOUND;
292303

293304
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() _LIBCPP_LIFETIMEBOUND { return __make_ref(0); }
294-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const _LIBCPP_LIFETIMEBOUND { return __make_ref(0); }
295-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() _LIBCPP_LIFETIMEBOUND { return __make_ref(__size_ - 1); }
296-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const _LIBCPP_LIFETIMEBOUND { return __make_ref(__size_ - 1); }
305+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const _LIBCPP_LIFETIMEBOUND {
306+
return __make_ref(0);
307+
}
308+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() _LIBCPP_LIFETIMEBOUND {
309+
return __make_ref(__size_ - 1);
310+
}
311+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const _LIBCPP_LIFETIMEBOUND {
312+
return __make_ref(__size_ - 1);
313+
}
297314

298315
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void push_back(const value_type& __x);
299316
#if _LIBCPP_STD_VER >= 14
@@ -322,12 +339,14 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
322339

323340
#if _LIBCPP_STD_VER >= 14
324341
template <class... _Args>
325-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator emplace(const_iterator __position, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
342+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator emplace(const_iterator __position, _Args&&... __args)
343+
_LIBCPP_LIFETIMEBOUND {
326344
return insert(__position, value_type(std::forward<_Args>(__args)...));
327345
}
328346
#endif
329347

330-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, const value_type& __x) _LIBCPP_LIFETIMEBOUND;
348+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, const value_type& __x)
349+
_LIBCPP_LIFETIMEBOUND;
331350
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
332351
insert(const_iterator __position, size_type __n, const value_type& __x) _LIBCPP_LIFETIMEBOUND;
333352
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
@@ -339,7 +358,8 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
339358

340359
#if _LIBCPP_STD_VER >= 23
341360
template <_ContainerCompatibleRange<bool> _Range>
342-
_LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
361+
_LIBCPP_HIDE_FROM_ABI constexpr iterator
362+
insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
343363
if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
344364
auto __n = static_cast<size_type>(ranges::distance(__range));
345365
return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
@@ -358,7 +378,8 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
358378
#endif
359379

360380
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __position) _LIBCPP_LIFETIMEBOUND;
361-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND;
381+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __first, const_iterator __last)
382+
_LIBCPP_LIFETIMEBOUND;
362383

363384
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void clear() _NOEXCEPT { __size_ = 0; }
364385

0 commit comments

Comments
 (0)