Skip to content

Commit 1bdd76e

Browse files
Add [[clang::lifetimebound]] to numerous functions in libc++ include headers
1 parent f35a14d commit 1bdd76e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+628
-628
lines changed

libcxx/include/__bit_reference

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,10 @@ struct __bit_array {
609609
std::__construct_at(__word_ + __i, 0);
610610
}
611611
}
612-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() {
612+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _LIBCPP_LIFETIMEBOUND {
613613
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
614614
}
615-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() {
615+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _LIBCPP_LIFETIMEBOUND {
616616
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
617617
static_cast<unsigned>(__size_ % __bits_per_word));
618618
}
@@ -905,7 +905,7 @@ public:
905905
return (__x.__seg_ - __y.__seg_) * __bits_per_word + __x.__ctz_ - __y.__ctz_;
906906
}
907907

908-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](difference_type __n) const {
908+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](difference_type __n) const _LIBCPP_LIFETIMEBOUND {
909909
return *(*this + __n);
910910
}
911911

libcxx/include/__chrono/tzdb_list.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ class _LIBCPP_AVAILABILITY_TZDB tzdb_list {
5353

5454
using const_iterator = forward_list<tzdb>::const_iterator;
5555

56-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const tzdb& front() const noexcept { return __front(); }
56+
[[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) { return __erase_after(__p); }
58+
_LIBCPP_HIDE_FROM_ABI const_iterator erase_after(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __erase_after(__p); }
5959

60-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept { return __begin(); }
61-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept { return __end(); }
60+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND { return __begin(); }
61+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND { return __end(); }
6262

63-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept { return __cbegin(); }
64-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept { return __cend(); }
63+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND { return __cbegin(); }
64+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept _LIBCPP_LIFETIMEBOUND { return __cend(); }
6565

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

libcxx/include/__expected/expected.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,15 +714,15 @@ class expected : private __expected_base<_Tp, _Err> {
714714

715715
template <class... _Args>
716716
requires is_nothrow_constructible_v<_Tp, _Args...>
717-
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& emplace(_Args&&... __args) noexcept {
717+
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& emplace(_Args&&... __args) noexcept _LIBCPP_LIFETIMEBOUND {
718718
this->__destroy();
719719
this->__construct(in_place, std::forward<_Args>(__args)...);
720720
return this->__val();
721721
}
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 {
725+
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) noexcept _LIBCPP_LIFETIMEBOUND {
726726
this->__destroy();
727727
this->__construct(in_place, __il, std::forward<_Args>(__args)...);
728728
return this->__val();

libcxx/include/__filesystem/directory_iterator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ operator!=(const directory_iterator& __lhs, const directory_iterator& __rhs) noe
124124
}
125125

126126
// enable directory_iterator range-based for statements
127-
inline _LIBCPP_HIDE_FROM_ABI directory_iterator begin(directory_iterator __iter) noexcept { return __iter; }
127+
inline _LIBCPP_HIDE_FROM_ABI directory_iterator begin(directory_iterator __iter) noexcept _LIBCPP_LIFETIMEBOUND { return __iter; }
128128

129-
inline _LIBCPP_HIDE_FROM_ABI directory_iterator end(directory_iterator) noexcept { return directory_iterator(); }
129+
inline _LIBCPP_HIDE_FROM_ABI directory_iterator end(directory_iterator) noexcept _LIBCPP_LIFETIMEBOUND { return directory_iterator(); }
130130

131131
_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
132132

libcxx/include/__filesystem/recursive_directory_iterator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ operator!=(const recursive_directory_iterator& __lhs, const recursive_directory_
133133
return !(__lhs == __rhs);
134134
}
135135
// enable recursive_directory_iterator range-based for statements
136-
inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator begin(recursive_directory_iterator __iter) noexcept {
136+
inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator begin(recursive_directory_iterator __iter) noexcept _LIBCPP_LIFETIMEBOUND {
137137
return __iter;
138138
}
139139

140-
inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator end(recursive_directory_iterator) noexcept {
140+
inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator end(recursive_directory_iterator) noexcept _LIBCPP_LIFETIMEBOUND {
141141
return recursive_directory_iterator();
142142
}
143143

libcxx/include/__format/format_parse_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class _LIBCPP_TEMPLATE_VIS basic_format_parse_context {
4141
basic_format_parse_context(const basic_format_parse_context&) = delete;
4242
basic_format_parse_context& operator=(const basic_format_parse_context&) = delete;
4343

44-
_LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept { return __begin_; }
45-
_LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept { return __end_; }
44+
_LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND { return __begin_; }
45+
_LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND { return __end_; }
4646
_LIBCPP_HIDE_FROM_ABI constexpr void advance_to(const_iterator __it) { __begin_ = __it; }
4747

4848
_LIBCPP_HIDE_FROM_ABI constexpr size_t next_arg_id() {

libcxx/include/__format/formatter_floating_point.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ class _LIBCPP_TEMPLATE_VIS __float_buffer {
183183
_LIBCPP_HIDE_FROM_ABI __float_buffer(const __float_buffer&) = delete;
184184
_LIBCPP_HIDE_FROM_ABI __float_buffer& operator=(const __float_buffer&) = delete;
185185

186-
_LIBCPP_HIDE_FROM_ABI char* begin() const { return __begin_; }
187-
_LIBCPP_HIDE_FROM_ABI char* end() const { return __begin_ + __size_; }
186+
_LIBCPP_HIDE_FROM_ABI char* begin() const _LIBCPP_LIFETIMEBOUND { return __begin_; }
187+
_LIBCPP_HIDE_FROM_ABI char* end() const _LIBCPP_LIFETIMEBOUND { return __begin_ + __size_; }
188188

189189
_LIBCPP_HIDE_FROM_ABI int __precision() const { return __precision_; }
190190
_LIBCPP_HIDE_FROM_ABI int __num_trailing_zeros() const { return __num_trailing_zeros_; }

libcxx/include/__hash_table

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -891,10 +891,10 @@ public:
891891

892892
_LIBCPP_HIDE_FROM_ABI size_type bucket_count() const _NOEXCEPT { return __bucket_list_.get_deleter().size(); }
893893

894-
_LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT;
895-
_LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT;
896-
_LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT;
897-
_LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT;
894+
_LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
895+
_LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
896+
_LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
897+
_LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
898898

899899
template <class _Key>
900900
_LIBCPP_HIDE_FROM_ABI size_type bucket(const _Key& __k) const {
@@ -904,15 +904,15 @@ public:
904904
}
905905

906906
template <class _Key>
907-
_LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __x);
907+
_LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __x) _LIBCPP_LIFETIMEBOUND;
908908
template <class _Key>
909-
_LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __x) const;
909+
_LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __x) const _LIBCPP_LIFETIMEBOUND;
910910

911911
typedef __hash_node_destructor<__node_allocator> _Dp;
912912
typedef unique_ptr<__node, _Dp> __node_holder;
913913

914-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
915-
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last);
914+
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND;
915+
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND;
916916
template <class _Key>
917917
_LIBCPP_HIDE_FROM_ABI size_type __erase_unique(const _Key& __k);
918918
template <class _Key>
@@ -958,25 +958,25 @@ public:
958958
max_load_factor() = std::max(__mlf, load_factor());
959959
}
960960

961-
_LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) {
961+
_LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) _LIBCPP_LIFETIMEBOUND {
962962
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
963963
__n < bucket_count(), "unordered container::begin(n) called with n >= bucket_count()");
964964
return local_iterator(__bucket_list_[__n], __n, bucket_count());
965965
}
966966

967-
_LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) {
967+
_LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) _LIBCPP_LIFETIMEBOUND {
968968
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
969969
__n < bucket_count(), "unordered container::end(n) called with n >= bucket_count()");
970970
return local_iterator(nullptr, __n, bucket_count());
971971
}
972972

973-
_LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const {
973+
_LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const _LIBCPP_LIFETIMEBOUND {
974974
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
975975
__n < bucket_count(), "unordered container::cbegin(n) called with n >= bucket_count()");
976976
return const_local_iterator(__bucket_list_[__n], __n, bucket_count());
977977
}
978978

979-
_LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const {
979+
_LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const _LIBCPP_LIFETIMEBOUND {
980980
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
981981
__n < bucket_count(), "unordered container::cend(n) called with n >= bucket_count()");
982982
return const_local_iterator(nullptr, __n, bucket_count());

libcxx/include/__iterator/access.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto cend(const _Cp& __c) noexcept(noexcept(std:
6969
#else // defined(_LIBCPP_CXX03_LANG)
7070

7171
template <class _Cp>
72-
_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator begin(_Cp& __c) {
72+
_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator begin(_Cp& __c) _LIBCPP_LIFETIMEBOUND {
7373
return __c.begin();
7474
}
7575

7676
template <class _Cp>
77-
_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator begin(const _Cp& __c) {
77+
_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator begin(const _Cp& __c) _LIBCPP_LIFETIMEBOUND {
7878
return __c.begin();
7979
}
8080

8181
template <class _Cp>
82-
_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator end(_Cp& __c) {
82+
_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator end(_Cp& __c) _LIBCPP_LIFETIMEBOUND {
8383
return __c.end();
8484
}
8585

8686
template <class _Cp>
87-
_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator end(const _Cp& __c) {
87+
_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator end(const _Cp& __c) _LIBCPP_LIFETIMEBOUND {
8888
return __c.end();
8989
}
9090

libcxx/include/__iterator/bounded_iter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ struct __bounded_iter {
118118
return std::__to_address(__current_);
119119
}
120120

121-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT {
121+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
122122
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
123123
__n >= __begin_ - __current_, "__bounded_iter::operator[]: Attempt to index an iterator past the start");
124124
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(

libcxx/include/__iterator/move_iterator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
140140
_LIBCPP_HIDE_FROM_ABI constexpr _Iter base() && { return std::move(__current_); }
141141

142142
_LIBCPP_HIDE_FROM_ABI constexpr reference operator*() const { return ranges::iter_move(__current_); }
143-
_LIBCPP_HIDE_FROM_ABI constexpr reference operator[](difference_type __n) const {
143+
_LIBCPP_HIDE_FROM_ABI constexpr reference operator[](difference_type __n) const _LIBCPP_LIFETIMEBOUND {
144144
return ranges::iter_move(__current_ + __n);
145145
}
146146

@@ -174,7 +174,7 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
174174
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator*() const {
175175
return static_cast<reference>(*__current_);
176176
}
177-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const {
177+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const _LIBCPP_LIFETIMEBOUND {
178178
return static_cast<reference>(__current_[__n]);
179179
}
180180

libcxx/include/__iterator/reverse_iterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
178178
current += __n;
179179
return *this;
180180
}
181-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const {
181+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const _LIBCPP_LIFETIMEBOUND {
182182
return *(*this + __n);
183183
}
184184

libcxx/include/__iterator/wrap_iter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class __wrap_iter {
8787
*this += -__n;
8888
return *this;
8989
}
90-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT {
90+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
9191
return __i_[__n];
9292
}
9393

libcxx/include/__mdspan/extents.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ struct __static_array {
7878
template <class _Tp, size_t _Size>
7979
struct __possibly_empty_array {
8080
_Tp __vals_[_Size];
81-
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator[](size_t __index) { return __vals_[__index]; }
82-
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __index) const { return __vals_[__index]; }
81+
_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]; }
8383
};
8484

8585
template <class _Tp>
8686
struct __possibly_empty_array<_Tp, 0> {
87-
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator[](size_t) { __libcpp_unreachable(); }
88-
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t) const { __libcpp_unreachable(); }
87+
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator[](size_t) _LIBCPP_LIFETIMEBOUND { __libcpp_unreachable(); }
88+
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t) const _LIBCPP_LIFETIMEBOUND { __libcpp_unreachable(); }
8989
};
9090

9191
// ------------------------------------------------------------------

libcxx/include/__mdspan/mdspan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class mdspan {
186186
requires((is_convertible_v<_OtherIndexTypes, index_type> && ...) &&
187187
(is_nothrow_constructible_v<index_type, _OtherIndexTypes> && ...) &&
188188
(sizeof...(_OtherIndexTypes) == rank()))
189-
_LIBCPP_HIDE_FROM_ABI constexpr reference operator[](_OtherIndexTypes... __indices) const {
189+
_LIBCPP_HIDE_FROM_ABI constexpr reference operator[](_OtherIndexTypes... __indices) const _LIBCPP_LIFETIMEBOUND {
190190
// Note the standard layouts would also check this, but user provided ones may not, so we
191191
// check the precondition here
192192
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__mdspan_detail::__is_multidimensional_index_in(extents(), __indices...),

libcxx/include/__memory/unique_ptr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ 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 { return __ptr_; }
278+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __ptr_; }
279279
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 deleter_type& get_deleter() _NOEXCEPT { return __deleter_; }
280280
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 const deleter_type& get_deleter() const _NOEXCEPT {
281281
return __deleter_;
@@ -585,7 +585,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
585585
"unique_ptr<T[]>::operator[](index): index out of range");
586586
return __ptr_[__i];
587587
}
588-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT { return __ptr_; }
588+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __ptr_; }
589589

590590
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 deleter_type& get_deleter() _NOEXCEPT { return __deleter_; }
591591

libcxx/include/__node_handle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ 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 { return static_cast<_Derived const*>(this)->__ptr_->__get_value(); }
173+
_LIBCPP_HIDE_FROM_ABI value_type& value() const _LIBCPP_LIFETIMEBOUND { return static_cast<_Derived const*>(this)->__ptr_->__get_value(); }
174174
};
175175

176176
template <class _NodeType, class _Derived>

libcxx/include/__ranges/chunk_by_view.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS chunk_by_view : public view_interface
110110

111111
_LIBCPP_HIDE_FROM_ABI constexpr const _Pred& pred() const { return *__pred_; }
112112

113-
_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {
113+
_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() _LIBCPP_LIFETIMEBOUND {
114114
// Note: this duplicates a check in `optional` but provides a better error message.
115115
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
116116
__pred_.__has_value(), "Trying to call begin() on a chunk_by_view that does not have a valid predicate.");

libcxx/include/__ranges/empty_view.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ template <class _Tp>
2929
requires is_object_v<_Tp>
3030
class empty_view : public view_interface<empty_view<_Tp>> {
3131
public:
32-
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; }
33-
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; }
32+
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept _LIBCPP_LIFETIMEBOUND { return nullptr; }
33+
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept _LIBCPP_LIFETIMEBOUND { return nullptr; }
3434
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; }
3535
_LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; }
3636
_LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; }

libcxx/include/__ranges/filter_view.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS filter_view : public view_interface<f
8585

8686
_LIBCPP_HIDE_FROM_ABI constexpr _Pred const& pred() const { return *__pred_; }
8787

88-
_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {
88+
_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() _LIBCPP_LIFETIMEBOUND {
8989
// Note: this duplicates a check in `optional` but provides a better error message.
9090
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
9191
__pred_.__has_value(), "Trying to call begin() on a filter_view that does not have a valid predicate.");

libcxx/include/__ranges/iota_view.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
329329
requires(!same_as<_Start, _BoundSentinel> && !same_as<_BoundSentinel, unreachable_sentinel_t>)
330330
: iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}
331331

332-
_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const { return __iterator{__value_}; }
332+
_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const _LIBCPP_LIFETIMEBOUND { return __iterator{__value_}; }
333333

334334
_LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
335335
if constexpr (same_as<_BoundSentinel, unreachable_sentinel_t>)

0 commit comments

Comments
 (0)