Skip to content

Commit

Permalink
Add [[clang::lifetimebound]] to numerous functions in libc++ include …
Browse files Browse the repository at this point in the history
…headers
  • Loading branch information
higher-performance committed Oct 17, 2024
1 parent f35a14d commit 14723c9
Show file tree
Hide file tree
Showing 52 changed files with 628 additions and 628 deletions.
6 changes: 3 additions & 3 deletions libcxx/include/__bit_reference
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,10 @@ struct __bit_array {
std::__construct_at(__word_ + __i, 0);
}
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
static_cast<unsigned>(__size_ % __bits_per_word));
}
Expand Down Expand Up @@ -905,7 +905,7 @@ public:
return (__x.__seg_ - __y.__seg_) * __bits_per_word + __x.__ctz_ - __y.__ctz_;
}

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](difference_type __n) const {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](difference_type __n) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return *(*this + __n);
}

Expand Down
12 changes: 6 additions & 6 deletions libcxx/include/__chrono/tzdb_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ class _LIBCPP_AVAILABILITY_TZDB tzdb_list {

using const_iterator = forward_list<tzdb>::const_iterator;

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

_LIBCPP_HIDE_FROM_ABI const_iterator erase_after(const_iterator __p) { return __erase_after(__p); }
_LIBCPP_HIDE_FROM_ABI const_iterator erase_after(const_iterator __p) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __erase_after(__p); }

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

[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept { return __cbegin(); }
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept { return __cend(); }
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __cbegin(); }
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __cend(); }

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

Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__expected/expected.h
Original file line number Diff line number Diff line change
Expand Up @@ -714,15 +714,15 @@ class expected : private __expected_base<_Tp, _Err> {

template <class... _Args>
requires is_nothrow_constructible_v<_Tp, _Args...>
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& emplace(_Args&&... __args) noexcept {
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& emplace(_Args&&... __args) noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
this->__destroy();
this->__construct(in_place, std::forward<_Args>(__args)...);
return this->__val();
}

template <class _Up, class... _Args>
requires is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, _Args...>
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) noexcept {
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
this->__destroy();
this->__construct(in_place, __il, std::forward<_Args>(__args)...);
return this->__val();
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__filesystem/directory_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ operator!=(const directory_iterator& __lhs, const directory_iterator& __rhs) noe
}

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

inline _LIBCPP_HIDE_FROM_ABI directory_iterator end(directory_iterator) noexcept { return directory_iterator(); }
inline _LIBCPP_HIDE_FROM_ABI directory_iterator end(directory_iterator) noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return directory_iterator(); }

_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP

Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__filesystem/recursive_directory_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ operator!=(const recursive_directory_iterator& __lhs, const recursive_directory_
return !(__lhs == __rhs);
}
// enable recursive_directory_iterator range-based for statements
inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator begin(recursive_directory_iterator __iter) noexcept {
inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator begin(recursive_directory_iterator __iter) noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return __iter;
}

inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator end(recursive_directory_iterator) noexcept {
inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator end(recursive_directory_iterator) noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return recursive_directory_iterator();
}

Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__format/format_parse_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class _LIBCPP_TEMPLATE_VIS basic_format_parse_context {
basic_format_parse_context(const basic_format_parse_context&) = delete;
basic_format_parse_context& operator=(const basic_format_parse_context&) = delete;

_LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept { return __begin_; }
_LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept { return __end_; }
_LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __begin_; }
_LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __end_; }
_LIBCPP_HIDE_FROM_ABI constexpr void advance_to(const_iterator __it) { __begin_ = __it; }

_LIBCPP_HIDE_FROM_ABI constexpr size_t next_arg_id() {
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__format/formatter_floating_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ class _LIBCPP_TEMPLATE_VIS __float_buffer {
_LIBCPP_HIDE_FROM_ABI __float_buffer(const __float_buffer&) = delete;
_LIBCPP_HIDE_FROM_ABI __float_buffer& operator=(const __float_buffer&) = delete;

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

_LIBCPP_HIDE_FROM_ABI int __precision() const { return __precision_; }
_LIBCPP_HIDE_FROM_ABI int __num_trailing_zeros() const { return __num_trailing_zeros_; }
Expand Down
24 changes: 12 additions & 12 deletions libcxx/include/__hash_table
Original file line number Diff line number Diff line change
Expand Up @@ -891,10 +891,10 @@ public:

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

_LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND;
_LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND;
_LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND;
_LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND;

template <class _Key>
_LIBCPP_HIDE_FROM_ABI size_type bucket(const _Key& __k) const {
Expand All @@ -904,15 +904,15 @@ public:
}

template <class _Key>
_LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __x);
_LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __x) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND;
template <class _Key>
_LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __x) const;
_LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __x) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND;

typedef __hash_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _Dp> __node_holder;

_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last);
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND;
_LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND;
template <class _Key>
_LIBCPP_HIDE_FROM_ABI size_type __erase_unique(const _Key& __k);
template <class _Key>
Expand Down Expand Up @@ -958,25 +958,25 @@ public:
max_load_factor() = std::max(__mlf, load_factor());
}

_LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) {
_LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__n < bucket_count(), "unordered container::begin(n) called with n >= bucket_count()");
return local_iterator(__bucket_list_[__n], __n, bucket_count());
}

_LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) {
_LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__n < bucket_count(), "unordered container::end(n) called with n >= bucket_count()");
return local_iterator(nullptr, __n, bucket_count());
}

_LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const {
_LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__n < bucket_count(), "unordered container::cbegin(n) called with n >= bucket_count()");
return const_local_iterator(__bucket_list_[__n], __n, bucket_count());
}

_LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const {
_LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__n < bucket_count(), "unordered container::cend(n) called with n >= bucket_count()");
return const_local_iterator(nullptr, __n, bucket_count());
Expand Down
8 changes: 4 additions & 4 deletions libcxx/include/__iterator/access.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,22 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto cend(const _Cp& __c) noexcept(noexcept(std:
#else // defined(_LIBCPP_CXX03_LANG)

template <class _Cp>
_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator begin(_Cp& __c) {
_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator begin(_Cp& __c) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return __c.begin();
}

template <class _Cp>
_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator begin(const _Cp& __c) {
_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator begin(const _Cp& __c) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return __c.begin();
}

template <class _Cp>
_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator end(_Cp& __c) {
_LIBCPP_HIDE_FROM_ABI typename _Cp::iterator end(_Cp& __c) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return __c.end();
}

template <class _Cp>
_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator end(const _Cp& __c) {
_LIBCPP_HIDE_FROM_ABI typename _Cp::const_iterator end(const _Cp& __c) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return __c.end();
}

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__iterator/bounded_iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct __bounded_iter {
return std::__to_address(__current_);
}

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__n >= __begin_ - __current_, "__bounded_iter::operator[]: Attempt to index an iterator past the start");
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__iterator/move_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
_LIBCPP_HIDE_FROM_ABI constexpr _Iter base() && { return std::move(__current_); }

_LIBCPP_HIDE_FROM_ABI constexpr reference operator*() const { return ranges::iter_move(__current_); }
_LIBCPP_HIDE_FROM_ABI constexpr reference operator[](difference_type __n) const {
_LIBCPP_HIDE_FROM_ABI constexpr reference operator[](difference_type __n) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return ranges::iter_move(__current_ + __n);
}

Expand Down Expand Up @@ -174,7 +174,7 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator*() const {
return static_cast<reference>(*__current_);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return static_cast<reference>(__current_[__n]);
}

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__iterator/reverse_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
current += __n;
return *this;
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](difference_type __n) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return *(*this + __n);
}

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__iterator/wrap_iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class __wrap_iter {
*this += -__n;
return *this;
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
return __i_[__n];
}

Expand Down
8 changes: 4 additions & 4 deletions libcxx/include/__mdspan/extents.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ struct __static_array {
template <class _Tp, size_t _Size>
struct __possibly_empty_array {
_Tp __vals_[_Size];
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator[](size_t __index) { return __vals_[__index]; }
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __index) const { return __vals_[__index]; }
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator[](size_t __index) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __vals_[__index]; }
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __index) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __vals_[__index]; }
};

template <class _Tp>
struct __possibly_empty_array<_Tp, 0> {
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator[](size_t) { __libcpp_unreachable(); }
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t) const { __libcpp_unreachable(); }
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator[](size_t) _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { __libcpp_unreachable(); }
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { __libcpp_unreachable(); }
};

// ------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__mdspan/mdspan.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class mdspan {
requires((is_convertible_v<_OtherIndexTypes, index_type> && ...) &&
(is_nothrow_constructible_v<index_type, _OtherIndexTypes> && ...) &&
(sizeof...(_OtherIndexTypes) == rank()))
_LIBCPP_HIDE_FROM_ABI constexpr reference operator[](_OtherIndexTypes... __indices) const {
_LIBCPP_HIDE_FROM_ABI constexpr reference operator[](_OtherIndexTypes... __indices) const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
// Note the standard layouts would also check this, but user provided ones may not, so we
// check the precondition here
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__mdspan_detail::__is_multidimensional_index_in(extents(), __indices...),
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__memory/unique_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
return *__ptr_;
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer operator->() const _NOEXCEPT { return __ptr_; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT { return __ptr_; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __ptr_; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 deleter_type& get_deleter() _NOEXCEPT { return __deleter_; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 const deleter_type& get_deleter() const _NOEXCEPT {
return __deleter_;
Expand Down Expand Up @@ -585,7 +585,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
"unique_ptr<T[]>::operator[](index): index out of range");
return __ptr_[__i];
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT { return __ptr_; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __ptr_; }

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

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__node_handle
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ template <class _NodeType, class _Derived>
struct __set_node_handle_specifics {
typedef typename _NodeType::__node_value_type value_type;

_LIBCPP_HIDE_FROM_ABI value_type& value() const { return static_cast<_Derived const*>(this)->__ptr_->__get_value(); }
_LIBCPP_HIDE_FROM_ABI value_type& value() const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return static_cast<_Derived const*>(this)->__ptr_->__get_value(); }
};

template <class _NodeType, class _Derived>
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/chunk_by_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS chunk_by_view : public view_interface

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

_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {
_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
// Note: this duplicates a check in `optional` but provides a better error message.
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__pred_.__has_value(), "Trying to call begin() on a chunk_by_view that does not have a valid predicate.");
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__ranges/empty_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ template <class _Tp>
requires is_object_v<_Tp>
class empty_view : public view_interface<empty_view<_Tp>> {
public:
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; }
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; }
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return nullptr; }
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return nullptr; }
_LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; }
_LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; }
_LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; }
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/filter_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS filter_view : public view_interface<f

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

_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {
_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND {
// Note: this duplicates a check in `optional` but provides a better error message.
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__pred_.__has_value(), "Trying to call begin() on a filter_view that does not have a valid predicate.");
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/iota_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
requires(!same_as<_Start, _BoundSentinel> && !same_as<_BoundSentinel, unreachable_sentinel_t>)
: iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}

_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const { return __iterator{__value_}; }
_LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const _LIBCPP_LIFETIMEBOUND _LIBCPP_LIFETIMEBOUND { return __iterator{__value_}; }

_LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
if constexpr (same_as<_BoundSentinel, unreachable_sentinel_t>)
Expand Down
Loading

0 comments on commit 14723c9

Please sign in to comment.