[libcxx-commits] [libcxx] Add [[clang::lifetimebound]] to numerous functions in libc++ include headers (PR #112751)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 17 10:26:09 PDT 2024


https://github.com/higher-performance created https://github.com/llvm/llvm-project/pull/112751

These were generated via the following Perl command:
```
find libcxx/include -xdev -type f -exec perl -0777 -pi -e 's/((?:(?:iterator|reference|[*&])(?:(?:,\s+bool)?>)?\s+(?:c?(?:after_|before_)?(?:begin|end)|front|back|find|lower_bound|upper_bound|equal_range|(?:emplace|erase|insert|operator\[\]|value)(?:_\w*)?)|pointer (?:data|get)|operator\s+__self_view)[(][^{()};]*[)](?:(?:noexcept|requires)(?:\s*[(](?:[^()]*|[^()]*[(][^()]*[)][^()]*)[)])?|\w+|\s+\b)*)(\s*)(\{|;)/$1 _LIBCPP_LIFETIMEBOUND$2$3/g' '{}' \+
```

>From 526187e7bfe2a5352eb90dcba9b08df3efacd9df Mon Sep 17 00:00:00 2001
From: higher-performance <higher.performance.github at gmail.com>
Date: Thu, 17 Oct 2024 13:25:28 -0400
Subject: [PATCH] Add [[clang::lifetimebound]] to numerous functions in libc++
 include headers

---
 libcxx/include/__bit_reference                |   6 +-
 libcxx/include/__chrono/tzdb_list.h           |  12 +-
 libcxx/include/__expected/expected.h          |   4 +-
 .../include/__filesystem/directory_iterator.h |   4 +-
 libcxx/include/__filesystem/path.h            |   4 +-
 .../recursive_directory_iterator.h            |   4 +-
 .../include/__format/format_parse_context.h   |   4 +-
 .../__format/formatter_floating_point.h       |   4 +-
 libcxx/include/__hash_table                   |  24 +-
 libcxx/include/__iterator/access.h            |   8 +-
 libcxx/include/__iterator/bounded_iter.h      |   2 +-
 libcxx/include/__iterator/move_iterator.h     |   4 +-
 libcxx/include/__iterator/reverse_iterator.h  |   2 +-
 libcxx/include/__iterator/wrap_iter.h         |   2 +-
 libcxx/include/__mdspan/extents.h             |   8 +-
 libcxx/include/__mdspan/mdspan.h              |   2 +-
 libcxx/include/__memory/unique_ptr.h          |   4 +-
 libcxx/include/__node_handle                  |   4 +-
 libcxx/include/__ranges/chunk_by_view.h       |   2 +-
 libcxx/include/__ranges/empty_view.h          |   4 +-
 libcxx/include/__ranges/filter_view.h         |   2 +-
 libcxx/include/__ranges/iota_view.h           |   2 +-
 libcxx/include/__ranges/repeat_view.h         |   6 +-
 libcxx/include/__ranges/single_view.h         |   8 +-
 libcxx/include/__ranges/split_view.h          |   2 +-
 libcxx/include/__split_buffer                 |  16 +-
 libcxx/include/__string/char_traits.h         |  12 +-
 libcxx/include/__thread/thread.h              |   2 +-
 libcxx/include/__tree                         |  28 +-
 libcxx/include/any                            |   8 +-
 libcxx/include/array                          |  72 ++---
 libcxx/include/bitset                         |   6 +-
 libcxx/include/chrono                         |  12 +-
 libcxx/include/deque                          |  98 +++---
 libcxx/include/experimental/__simd/simd.h     |   2 +-
 .../include/experimental/__simd/simd_mask.h   |   2 +-
 libcxx/include/experimental/memory            |   2 +-
 libcxx/include/ext/hash_map                   |  80 ++---
 libcxx/include/ext/hash_set                   |  76 ++---
 libcxx/include/filesystem                     |  12 +-
 libcxx/include/forward_list                   |  84 ++---
 libcxx/include/initializer_list               |  16 +-
 libcxx/include/iterator                       |   2 +-
 libcxx/include/list                           |  92 +++---
 libcxx/include/map                            | 300 +++++++++---------
 libcxx/include/mdspan                         |   2 +-
 libcxx/include/memory                         |   6 +-
 libcxx/include/optional                       |   8 +-
 libcxx/include/queue                          |  18 +-
 libcxx/include/regex                          |  20 +-
 libcxx/include/set                            | 252 +++++++--------
 libcxx/include/span                           |  36 +--
 libcxx/include/stack                          |   2 +-
 libcxx/include/string                         | 114 +++----
 libcxx/include/string_view                    |  32 +-
 libcxx/include/unordered_map                  | 276 ++++++++--------
 libcxx/include/unordered_set                  | 240 +++++++-------
 libcxx/include/valarray                       |  32 +-
 libcxx/include/variant                        |  18 +-
 libcxx/include/vector                         | 170 +++++-----
 60 files changed, 1138 insertions(+), 1138 deletions(-)

diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference
index 22637d43974123..930062ea471b1e 100644
--- a/libcxx/include/__bit_reference
+++ b/libcxx/include/__bit_reference
@@ -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 {
     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 {
     return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
                     static_cast<unsigned>(__size_ % __bits_per_word));
   }
@@ -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 {
     return *(*this + __n);
   }
 
diff --git a/libcxx/include/__chrono/tzdb_list.h b/libcxx/include/__chrono/tzdb_list.h
index 18446d9926d9dc..bb140128364f3b 100644
--- a/libcxx/include/__chrono/tzdb_list.h
+++ b/libcxx/include/__chrono/tzdb_list.h
@@ -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 { 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 { 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 { return __begin(); }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept _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 { return __cbegin(); }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept _LIBCPP_LIFETIMEBOUND { return __cend(); }
 
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI __impl& __implementation() { return *__impl_; }
 
diff --git a/libcxx/include/__expected/expected.h b/libcxx/include/__expected/expected.h
index 3d3f11967ee746..883b60008a0232 100644
--- a/libcxx/include/__expected/expected.h
+++ b/libcxx/include/__expected/expected.h
@@ -714,7 +714,7 @@ 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 {
     this->__destroy();
     this->__construct(in_place, std::forward<_Args>(__args)...);
     return this->__val();
@@ -722,7 +722,7 @@ class expected : private __expected_base<_Tp, _Err> {
 
   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 {
     this->__destroy();
     this->__construct(in_place, __il, std::forward<_Args>(__args)...);
     return this->__val();
diff --git a/libcxx/include/__filesystem/directory_iterator.h b/libcxx/include/__filesystem/directory_iterator.h
index e0246d8001e195..4ba09cd42dbe7b 100644
--- a/libcxx/include/__filesystem/directory_iterator.h
+++ b/libcxx/include/__filesystem/directory_iterator.h
@@ -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 { 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 { return directory_iterator(); }
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
 
diff --git a/libcxx/include/__filesystem/path.h b/libcxx/include/__filesystem/path.h
index 2eb60810af02b5..70dea519160c55 100644
--- a/libcxx/include/__filesystem/path.h
+++ b/libcxx/include/__filesystem/path.h
@@ -864,8 +864,8 @@ class _LIBCPP_EXPORTED_FROM_ABI path {
   class _LIBCPP_EXPORTED_FROM_ABI iterator;
   typedef iterator const_iterator;
 
-  iterator begin() const;
-  iterator end() const;
+  iterator begin() const _LIBCPP_LIFETIMEBOUND;
+  iterator end() const _LIBCPP_LIFETIMEBOUND;
 
 #  if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
   template <
diff --git a/libcxx/include/__filesystem/recursive_directory_iterator.h b/libcxx/include/__filesystem/recursive_directory_iterator.h
index caa1396eb301fc..497cae0f6e9390 100644
--- a/libcxx/include/__filesystem/recursive_directory_iterator.h
+++ b/libcxx/include/__filesystem/recursive_directory_iterator.h
@@ -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 {
   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 {
   return recursive_directory_iterator();
 }
 
diff --git a/libcxx/include/__format/format_parse_context.h b/libcxx/include/__format/format_parse_context.h
index 54c23014e7dc60..493d397bc43ffe 100644
--- a/libcxx/include/__format/format_parse_context.h
+++ b/libcxx/include/__format/format_parse_context.h
@@ -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 { return __begin_; }
+  _LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept _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() {
diff --git a/libcxx/include/__format/formatter_floating_point.h b/libcxx/include/__format/formatter_floating_point.h
index fc95dd3f22bbe7..9e98e0e058ce04 100644
--- a/libcxx/include/__format/formatter_floating_point.h
+++ b/libcxx/include/__format/formatter_floating_point.h
@@ -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 { return __begin_; }
+  _LIBCPP_HIDE_FROM_ABI char* end() const _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_; }
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index 560e873adc3846..8d93b5c324b62d 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -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_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
 
   template <class _Key>
   _LIBCPP_HIDE_FROM_ABI size_type bucket(const _Key& __k) const {
@@ -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;
   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;
 
   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_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND;
   template <class _Key>
   _LIBCPP_HIDE_FROM_ABI size_type __erase_unique(const _Key& __k);
   template <class _Key>
@@ -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_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_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_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_ASSERT_VALID_ELEMENT_ACCESS(
         __n < bucket_count(), "unordered container::cend(n) called with n >= bucket_count()");
     return const_local_iterator(nullptr, __n, bucket_count());
diff --git a/libcxx/include/__iterator/access.h b/libcxx/include/__iterator/access.h
index acc4f60bf697ea..82d1d4b7de1653 100644
--- a/libcxx/include/__iterator/access.h
+++ b/libcxx/include/__iterator/access.h
@@ -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 {
   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 {
   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 {
   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 {
   return __c.end();
 }
 
diff --git a/libcxx/include/__iterator/bounded_iter.h b/libcxx/include/__iterator/bounded_iter.h
index 5a86bd98e71940..e499e4c8bbcd12 100644
--- a/libcxx/include/__iterator/bounded_iter.h
+++ b/libcxx/include/__iterator/bounded_iter.h
@@ -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_ASSERT_VALID_ELEMENT_ACCESS(
         __n >= __begin_ - __current_, "__bounded_iter::operator[]: Attempt to index an iterator past the start");
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
diff --git a/libcxx/include/__iterator/move_iterator.h b/libcxx/include/__iterator/move_iterator.h
index a1c53e9bd2b596..fb2bd2b8ca174b 100644
--- a/libcxx/include/__iterator/move_iterator.h
+++ b/libcxx/include/__iterator/move_iterator.h
@@ -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 {
     return ranges::iter_move(__current_ + __n);
   }
 
@@ -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 {
     return static_cast<reference>(__current_[__n]);
   }
 
diff --git a/libcxx/include/__iterator/reverse_iterator.h b/libcxx/include/__iterator/reverse_iterator.h
index 50c0f21eaa286b..6022e2abb8dc01 100644
--- a/libcxx/include/__iterator/reverse_iterator.h
+++ b/libcxx/include/__iterator/reverse_iterator.h
@@ -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 {
     return *(*this + __n);
   }
 
diff --git a/libcxx/include/__iterator/wrap_iter.h b/libcxx/include/__iterator/wrap_iter.h
index 549d8ff2dbd7db..26b5e28800e68e 100644
--- a/libcxx/include/__iterator/wrap_iter.h
+++ b/libcxx/include/__iterator/wrap_iter.h
@@ -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 {
     return __i_[__n];
   }
 
diff --git a/libcxx/include/__mdspan/extents.h b/libcxx/include/__mdspan/extents.h
index 3d2c2771a834b4..c7fda349cf4b10 100644
--- a/libcxx/include/__mdspan/extents.h
+++ b/libcxx/include/__mdspan/extents.h
@@ -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 { return __vals_[__index]; }
+  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __index) const _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_unreachable(); }
+  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t) const _LIBCPP_LIFETIMEBOUND { __libcpp_unreachable(); }
 };
 
 // ------------------------------------------------------------------
diff --git a/libcxx/include/__mdspan/mdspan.h b/libcxx/include/__mdspan/mdspan.h
index 1ff4fd4ba4a829..3f41c8ea364e6a 100644
--- a/libcxx/include/__mdspan/mdspan.h
+++ b/libcxx/include/__mdspan/mdspan.h
@@ -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 {
     // 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...),
diff --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h
index 6e42ef1eaa1a3c..e547da76c487a5 100644
--- a/libcxx/include/__memory/unique_ptr.h
+++ b/libcxx/include/__memory/unique_ptr.h
@@ -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 { 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_;
@@ -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 { return __ptr_; }
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 deleter_type& get_deleter() _NOEXCEPT { return __deleter_; }
 
diff --git a/libcxx/include/__node_handle b/libcxx/include/__node_handle
index d0b35bfd193409..ec82350152f7df 100644
--- a/libcxx/include/__node_handle
+++ b/libcxx/include/__node_handle
@@ -38,7 +38,7 @@ public:
   ~node-handle();
 
   // [container.node.observers], observers
-  value_type& value() const;            // not present for map containers
+  value_type& value() const _LIBCPP_LIFETIMEBOUND;            // not present for map containers
   key_type& key() const;                // not present for set containers
   mapped_type& mapped() const;          // not present for set containers
 
@@ -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 { return static_cast<_Derived const*>(this)->__ptr_->__get_value(); }
 };
 
 template <class _NodeType, class _Derived>
diff --git a/libcxx/include/__ranges/chunk_by_view.h b/libcxx/include/__ranges/chunk_by_view.h
index e4df589bc286f7..631383a60aa270 100644
--- a/libcxx/include/__ranges/chunk_by_view.h
+++ b/libcxx/include/__ranges/chunk_by_view.h
@@ -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 {
     // 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.");
diff --git a/libcxx/include/__ranges/empty_view.h b/libcxx/include/__ranges/empty_view.h
index 6c04b0200c35f2..6013b8df11a4f9 100644
--- a/libcxx/include/__ranges/empty_view.h
+++ b/libcxx/include/__ranges/empty_view.h
@@ -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 { return nullptr; }
+  _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept _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; }
diff --git a/libcxx/include/__ranges/filter_view.h b/libcxx/include/__ranges/filter_view.h
index 22f67b2d967d56..7856ea8fd68d53 100644
--- a/libcxx/include/__ranges/filter_view.h
+++ b/libcxx/include/__ranges/filter_view.h
@@ -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 {
     // 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.");
diff --git a/libcxx/include/__ranges/iota_view.h b/libcxx/include/__ranges/iota_view.h
index b2fa958a0f56e0..29b22a89e9bc80 100644
--- a/libcxx/include/__ranges/iota_view.h
+++ b/libcxx/include/__ranges/iota_view.h
@@ -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 { return __iterator{__value_}; }
 
   _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
     if constexpr (same_as<_BoundSentinel, unreachable_sentinel_t>)
diff --git a/libcxx/include/__ranges/repeat_view.h b/libcxx/include/__ranges/repeat_view.h
index 53e4beb270ad01..45174c26148324 100644
--- a/libcxx/include/__ranges/repeat_view.h
+++ b/libcxx/include/__ranges/repeat_view.h
@@ -107,10 +107,10 @@ class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS repeat_view : public view_interface<r
           __bound_ >= 0, "The behavior is undefined if Bound is not unreachable_sentinel_t and bound is negative");
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const { return __iterator(std::addressof(*__value_)); }
+  _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const _LIBCPP_LIFETIMEBOUND { return __iterator(std::addressof(*__value_)); }
 
   _LIBCPP_HIDE_FROM_ABI constexpr __iterator end() const
-    requires(!same_as<_Bound, unreachable_sentinel_t>)
+    requires(!same_as<_Bound, unreachable_sentinel_t>) _LIBCPP_LIFETIMEBOUND
   {
     return __iterator(std::addressof(*__value_), __bound_);
   }
@@ -191,7 +191,7 @@ class repeat_view<_Tp, _Bound>::__iterator {
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](difference_type __n) const noexcept { return *(*this + __n); }
+  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](difference_type __n) const noexcept _LIBCPP_LIFETIMEBOUND { return *(*this + __n); }
 
   _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) {
     return __x.__current_ == __y.__current_;
diff --git a/libcxx/include/__ranges/single_view.h b/libcxx/include/__ranges/single_view.h
index 45244f34994d74..25f4454e3414d8 100644
--- a/libcxx/include/__ranges/single_view.h
+++ b/libcxx/include/__ranges/single_view.h
@@ -62,13 +62,13 @@ class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS single_view : public view_interface<s
   _LIBCPP_HIDE_FROM_ABI constexpr explicit single_view(in_place_t, _Args&&... __args)
       : __value_{in_place, std::forward<_Args>(__args)...} {}
 
-  _LIBCPP_HIDE_FROM_ABI constexpr _Tp* begin() noexcept { return data(); }
+  _LIBCPP_HIDE_FROM_ABI constexpr _Tp* begin() noexcept _LIBCPP_LIFETIMEBOUND { return data(); }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* begin() const noexcept { return data(); }
+  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* begin() const noexcept _LIBCPP_LIFETIMEBOUND { return data(); }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr _Tp* end() noexcept { return data() + 1; }
+  _LIBCPP_HIDE_FROM_ABI constexpr _Tp* end() noexcept _LIBCPP_LIFETIMEBOUND { return data() + 1; }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* end() const noexcept { return data() + 1; }
+  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp* end() const noexcept _LIBCPP_LIFETIMEBOUND { return data() + 1; }
 
   _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return false; }
 
diff --git a/libcxx/include/__ranges/split_view.h b/libcxx/include/__ranges/split_view.h
index 7527281905ffeb..1f8d0a4aab3f32 100644
--- a/libcxx/include/__ranges/split_view.h
+++ b/libcxx/include/__ranges/split_view.h
@@ -96,7 +96,7 @@ class split_view : public view_interface<split_view<_View, _Pattern>> {
 
   _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() {
+  _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() _LIBCPP_LIFETIMEBOUND {
     if (!__cached_begin_.__has_value()) {
       __cached_begin_.__emplace(__find_next(ranges::begin(__base_)));
     }
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index c4817601039f3b..147e471852aee4 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -114,11 +114,11 @@ public:
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer& __end_cap() _NOEXCEPT { return __end_cap_; }
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const pointer& __end_cap() const _NOEXCEPT { return __end_cap_; }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __begin_; }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __begin_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __begin_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __begin_; }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __end_; }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __end_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __end_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __end_; }
 
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __destruct_at_end(__begin_); }
 
@@ -140,10 +140,10 @@ public:
     return static_cast<size_type>(__end_cap() - __end_);
   }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() { return *__begin_; }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const { return *__begin_; }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() { return *(__end_ - 1); }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const { return *(__end_ - 1); }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _LIBCPP_LIFETIMEBOUND { return *__begin_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _LIBCPP_LIFETIMEBOUND { return *__begin_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _LIBCPP_LIFETIMEBOUND { return *(__end_ - 1); }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _LIBCPP_LIFETIMEBOUND { return *(__end_ - 1); }
 
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
diff --git a/libcxx/include/__string/char_traits.h b/libcxx/include/__string/char_traits.h
index 107f0a96a02277..c9beb9b4404233 100644
--- a/libcxx/include/__string/char_traits.h
+++ b/libcxx/include/__string/char_traits.h
@@ -62,7 +62,7 @@ exposition-only to document what members a char_traits specialization should pro
 
     static int              compare(const char_type*, const char_type*, size_t);
     static size_t           length(const char_type*);
-    static const char_type* find(const char_type*, size_t, const char_type&);
+    static const char_type* find(const char_type*, size_t, const char_type&) _LIBCPP_LIFETIMEBOUND;
     static char_type*       move(char_type*, const char_type*, size_t);
     static char_type*       copy(char_type*, const char_type*, size_t);
     static char_type*       assign(char_type*, size_t, char_type);
@@ -131,7 +131,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char> {
   }
 
   static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*
-  find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
+  find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     if (__n == 0)
       return nullptr;
     return std::__constexpr_memchr(__s, __a, __n);
@@ -249,7 +249,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t> : __char_traits_base<wchar_t, w
   }
 
   static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*
-  find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
+  find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     if (__n == 0)
       return nullptr;
     return std::__constexpr_wmemchr(__s, __a, __n);
@@ -272,7 +272,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t>
   }
 
   _LIBCPP_HIDE_FROM_ABI static constexpr const char_type*
-  find(const char_type* __s, size_t __n, const char_type& __a) noexcept {
+  find(const char_type* __s, size_t __n, const char_type& __a) noexcept _LIBCPP_LIFETIMEBOUND {
     return std::__constexpr_memchr(__s, __a, __n);
   }
 };
@@ -287,7 +287,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char16_t>
   _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT;
 
   _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*
-  find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
+  find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     __identity __proj;
     const char_type* __match = std::__find(__s, __s + __n, __a, __proj);
     if (__match == __s + __n)
@@ -322,7 +322,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char32_t>
   _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT;
 
   _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type*
-  find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
+  find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     __identity __proj;
     const char_type* __match = std::__find(__s, __s + __n, __a, __proj);
     if (__match == __s + __n)
diff --git a/libcxx/include/__thread/thread.h b/libcxx/include/__thread/thread.h
index 481a3f38b82f0f..c9593a8dd7ce6b 100644
--- a/libcxx/include/__thread/thread.h
+++ b/libcxx/include/__thread/thread.h
@@ -82,7 +82,7 @@ class __thread_specific_ptr {
   __thread_specific_ptr& operator=(const __thread_specific_ptr&) = delete;
   ~__thread_specific_ptr();
 
-  _LIBCPP_HIDE_FROM_ABI pointer get() const { return static_cast<_Tp*>(__libcpp_tls_get(__key_)); }
+  _LIBCPP_HIDE_FROM_ABI pointer get() const _LIBCPP_LIFETIMEBOUND { return static_cast<_Tp*>(__libcpp_tls_get(__key_)); }
   _LIBCPP_HIDE_FROM_ABI pointer operator*() const { return *get(); }
   _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return get(); }
   void set_pointer(pointer __p);
diff --git a/libcxx/include/__tree b/libcxx/include/__tree
index f6ef21cdaa5b98..607ce57eafa0d4 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -961,8 +961,8 @@ private:
 
 public:
   _LIBCPP_HIDE_FROM_ABI const size_type& size() const _NOEXCEPT { return __size_; }
-  _LIBCPP_HIDE_FROM_ABI value_compare& value_comp() _NOEXCEPT { return __value_comp_; }
-  _LIBCPP_HIDE_FROM_ABI const value_compare& value_comp() const _NOEXCEPT { return __value_comp_; }
+  _LIBCPP_HIDE_FROM_ABI value_compare& value_comp() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __value_comp_; }
+  _LIBCPP_HIDE_FROM_ABI const value_compare& value_comp() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __value_comp_; }
 
 public:
   _LIBCPP_HIDE_FROM_ABI __node_pointer __root() const _NOEXCEPT {
@@ -994,10 +994,10 @@ public:
           is_nothrow_move_assignable<__node_allocator>::value);
   _LIBCPP_HIDE_FROM_ABI ~__tree();
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return iterator(__begin_node()); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return const_iterator(__begin_node()); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return iterator(__end_node()); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return const_iterator(__end_node()); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(__begin_node()); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(__begin_node()); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(__end_node()); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(__end_node()); }
 
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
     return std::min<size_type>(__node_traits::max_size(__node_alloc()), numeric_limits<difference_type >::max());
@@ -1170,8 +1170,8 @@ public:
   _LIBCPP_HIDE_FROM_ABI _NodeHandle __node_handle_extract(const_iterator);
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l);
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) _LIBCPP_LIFETIMEBOUND;
   template <class _Key>
   _LIBCPP_HIDE_FROM_ABI size_type __erase_unique(const _Key& __k);
   template <class _Key>
@@ -1181,9 +1181,9 @@ public:
   __insert_node_at(__parent_pointer __parent, __node_base_pointer& __child, __node_base_pointer __new_node) _NOEXCEPT;
 
   template <class _Key>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __v);
+  _LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __v) _LIBCPP_LIFETIMEBOUND;
   template <class _Key>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __v) const;
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __v) const _LIBCPP_LIFETIMEBOUND;
 
   template <class _Key>
   _LIBCPP_HIDE_FROM_ABI size_type __count_unique(const _Key& __k) const;
@@ -1191,26 +1191,26 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type __count_multi(const _Key& __k) const;
 
   template <class _Key>
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _Key& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _Key& __v) _LIBCPP_LIFETIMEBOUND {
     return __lower_bound(__v, __root(), __end_node());
   }
   template <class _Key>
   _LIBCPP_HIDE_FROM_ABI iterator __lower_bound(const _Key& __v, __node_pointer __root, __iter_pointer __result);
   template <class _Key>
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _Key& __v) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _Key& __v) const _LIBCPP_LIFETIMEBOUND {
     return __lower_bound(__v, __root(), __end_node());
   }
   template <class _Key>
   _LIBCPP_HIDE_FROM_ABI const_iterator
   __lower_bound(const _Key& __v, __node_pointer __root, __iter_pointer __result) const;
   template <class _Key>
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _Key& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _Key& __v) _LIBCPP_LIFETIMEBOUND {
     return __upper_bound(__v, __root(), __end_node());
   }
   template <class _Key>
   _LIBCPP_HIDE_FROM_ABI iterator __upper_bound(const _Key& __v, __node_pointer __root, __iter_pointer __result);
   template <class _Key>
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _Key& __v) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _Key& __v) const _LIBCPP_LIFETIMEBOUND {
     return __upper_bound(__v, __root(), __end_node());
   }
   template <class _Key>
diff --git a/libcxx/include/any b/libcxx/include/any
index e32aa7f8e8a420..9254a5a01c346e 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -45,9 +45,9 @@ namespace std {
 
     // 6.3.3 any modifiers
     template <class ValueType, class... Args>
-      decay_t<ValueType>& emplace(Args&&... args);
+      decay_t<ValueType>& emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND;
     template <class ValueType, class U, class... Args>
-      decay_t<ValueType>& emplace(initializer_list<U>, Args&&...);
+      decay_t<ValueType>& emplace(initializer_list<U>, Args&&...) _LIBCPP_LIFETIMEBOUND;
     void reset() noexcept;
     void swap(any& rhs) noexcept;
 
@@ -245,7 +245,7 @@ public:
             class... _Args,
             class _Tp = decay_t<_ValueType>,
             class     = enable_if_t< is_constructible<_Tp, _Args...>::value && is_copy_constructible<_Tp>::value> >
-  _LIBCPP_HIDE_FROM_ABI _Tp& emplace(_Args&&...);
+  _LIBCPP_HIDE_FROM_ABI _Tp& emplace(_Args&&...) _LIBCPP_LIFETIMEBOUND;
 
   template <class _ValueType,
             class _Up,
@@ -253,7 +253,7 @@ public:
             class _Tp = decay_t<_ValueType>,
             class     = enable_if_t< is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
                                      is_copy_constructible<_Tp>::value> >
-  _LIBCPP_HIDE_FROM_ABI _Tp& emplace(initializer_list<_Up>, _Args&&...);
+  _LIBCPP_HIDE_FROM_ABI _Tp& emplace(initializer_list<_Up>, _Args&&...) _LIBCPP_LIFETIMEBOUND;
 
   // 6.3.3 any modifiers
   _LIBCPP_HIDE_FROM_ABI void reset() _NOEXCEPT {
diff --git a/libcxx/include/array b/libcxx/include/array
index 0e9af4198632d1..7ceb2fa15ce989 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -36,18 +36,18 @@ struct array
     void swap(array& a) noexcept(is_nothrow_swappable_v<T>);    // constexpr in C++20
 
     // iterators:
-    iterator begin() noexcept;                                  // constexpr in C++17
-    const_iterator begin() const noexcept;                      // constexpr in C++17
-    iterator end() noexcept;                                    // constexpr in C++17
-    const_iterator end() const noexcept;                        // constexpr in C++17
+    iterator begin() noexcept _LIBCPP_LIFETIMEBOUND;                                  // constexpr in C++17
+    const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;                      // constexpr in C++17
+    iterator end() noexcept _LIBCPP_LIFETIMEBOUND;                                    // constexpr in C++17
+    const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND;                        // constexpr in C++17
 
     reverse_iterator rbegin() noexcept;                         // constexpr in C++17
     const_reverse_iterator rbegin() const noexcept;             // constexpr in C++17
     reverse_iterator rend() noexcept;                           // constexpr in C++17
     const_reverse_iterator rend() const noexcept;               // constexpr in C++17
 
-    const_iterator cbegin() const noexcept;                     // constexpr in C++17
-    const_iterator cend() const noexcept;                       // constexpr in C++17
+    const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;                     // constexpr in C++17
+    const_iterator cend() const noexcept _LIBCPP_LIFETIMEBOUND;                       // constexpr in C++17
     const_reverse_iterator crbegin() const noexcept;            // constexpr in C++17
     const_reverse_iterator crend() const noexcept;              // constexpr in C++17
 
@@ -57,15 +57,15 @@ struct array
     constexpr bool empty() const noexcept;
 
     // element access:
-    reference operator[](size_type n);                          // constexpr in C++17
-    const_reference operator[](size_type n) const;              // constexpr in C++14
+    reference operator[](size_type n) _LIBCPP_LIFETIMEBOUND;                          // constexpr in C++17
+    const_reference operator[](size_type n) const _LIBCPP_LIFETIMEBOUND;              // constexpr in C++14
     reference at(size_type n);                                  // constexpr in C++17
     const_reference at(size_type n) const;                      // constexpr in C++14
 
-    reference front();                                          // constexpr in C++17
-    const_reference front() const;                              // constexpr in C++14
-    reference back();                                           // constexpr in C++17
-    const_reference back() const;                               // constexpr in C++14
+    reference front() _LIBCPP_LIFETIMEBOUND;                                          // constexpr in C++17
+    const_reference front() const _LIBCPP_LIFETIMEBOUND;                              // constexpr in C++14
+    reference back() _LIBCPP_LIFETIMEBOUND;                                           // constexpr in C++17
+    const_reference back() const _LIBCPP_LIFETIMEBOUND;                               // constexpr in C++14
 
     T* data() noexcept;                                         // constexpr in C++17
     const T* data() const noexcept;                             // constexpr in C++17
@@ -201,12 +201,12 @@ struct _LIBCPP_TEMPLATE_VIS array {
   }
 
   // iterators:
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT { return iterator(data()); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator begin() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(data()); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return const_iterator(data());
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator end() _NOEXCEPT { return iterator(data() + _Size); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator end() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(data() + _Size); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return const_iterator(data() + _Size);
   }
 
@@ -223,8 +223,8 @@ struct _LIBCPP_TEMPLATE_VIS array {
     return const_reverse_iterator(begin());
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cbegin() const _NOEXCEPT { return begin(); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cend() const _NOEXCEPT { return end(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crbegin() const _NOEXCEPT {
     return rbegin();
   }
@@ -236,11 +236,11 @@ struct _LIBCPP_TEMPLATE_VIS array {
   [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return _Size == 0; }
 
   // element access:
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type __n) _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type __n) _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < _Size, "out-of-bounds access in std::array<T, N>");
     return __elems_[__n];
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference operator[](size_type __n) const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference operator[](size_type __n) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < _Size, "out-of-bounds access in std::array<T, N>");
     return __elems_[__n];
   }
@@ -257,10 +257,10 @@ struct _LIBCPP_TEMPLATE_VIS array {
     return __elems_[__n];
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference front() _NOEXCEPT { return (*this)[0]; }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference front() const _NOEXCEPT { return (*this)[0]; }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference back() _NOEXCEPT { return (*this)[_Size - 1]; }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference back() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference front() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return (*this)[0]; }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference front() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return (*this)[0]; }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference back() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return (*this)[_Size - 1]; }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference back() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return (*this)[_Size - 1];
   }
 
@@ -309,12 +309,12 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> {
   }
 
   // iterators:
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT { return iterator(data()); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator begin() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(data()); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return const_iterator(data());
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator end() _NOEXCEPT { return iterator(data()); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator end() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(data()); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return const_iterator(data());
   }
 
@@ -331,8 +331,8 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> {
     return const_reverse_iterator(begin());
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cbegin() const _NOEXCEPT { return begin(); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cend() const _NOEXCEPT { return end(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crbegin() const _NOEXCEPT {
     return rbegin();
   }
@@ -344,12 +344,12 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> {
   [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return true; }
 
   // element access:
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type) _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference operator[](size_type) _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
     __libcpp_unreachable();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference operator[](size_type) const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference operator[](size_type) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
     __libcpp_unreachable();
   }
@@ -364,22 +364,22 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> {
     __libcpp_unreachable();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference front() _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference front() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::front() on a zero-sized array");
     __libcpp_unreachable();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference front() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference front() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::front() on a zero-sized array");
     __libcpp_unreachable();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference back() _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference back() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::back() on a zero-sized array");
     __libcpp_unreachable();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference back() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference back() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "cannot call array<T, 0>::back() on a zero-sized array");
     __libcpp_unreachable();
   }
diff --git a/libcxx/include/bitset b/libcxx/include/bitset
index f90ceaab816cca..aa74e8f9bc00cf 100644
--- a/libcxx/include/bitset
+++ b/libcxx/include/bitset
@@ -78,7 +78,7 @@ public:
 
     // element access:
     constexpr bool operator[](size_t pos) const;
-    reference operator[](size_t pos);            // constexpr since C++23
+    reference operator[](size_t pos) _LIBCPP_LIFETIMEBOUND;            // constexpr since C++23
     unsigned long to_ulong() const;              // constexpr since C++23
     unsigned long long to_ullong() const;        // constexpr since C++23
     template <class charT, class traits, class Allocator> // constexpr since C++23
@@ -683,9 +683,9 @@ public:
 #ifdef _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator[](size_t __p) const { return base::__make_ref(__p); }
 #else
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference operator[](size_t __p) const { return base::__make_ref(__p); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference operator[](size_t __p) const _LIBCPP_LIFETIMEBOUND { return base::__make_ref(__p); }
 #endif
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference operator[](size_t __p) { return base::__make_ref(__p); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference operator[](size_t __p) _LIBCPP_LIFETIMEBOUND { return base::__make_ref(__p); }
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const;
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong() const;
   template <class _CharT, class _Traits, class _Allocator>
diff --git a/libcxx/include/chrono b/libcxx/include/chrono
index 7bec5e5a26ef4a..a2387b7c810087 100644
--- a/libcxx/include/chrono
+++ b/libcxx/include/chrono
@@ -703,15 +703,15 @@ public:
 
   class const_iterator;
 
-  const tzdb& front() const noexcept;
+  const tzdb& front() const noexcept _LIBCPP_LIFETIMEBOUND;
 
-  const_iterator erase_after(const_iterator p);
+  const_iterator erase_after(const_iterator p) _LIBCPP_LIFETIMEBOUND;
 
-  const_iterator begin() const noexcept;
-  const_iterator end()   const noexcept;
+  const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+  const_iterator end()   const noexcept _LIBCPP_LIFETIMEBOUND;
 
-  const_iterator cbegin() const noexcept;
-  const_iterator cend()   const noexcept;
+  const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;
+  const_iterator cend()   const noexcept _LIBCPP_LIFETIMEBOUND;
 };
 
 // [time.zone.db.access], time zone database access
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 11219d1a99244e..d9cbc294709e67 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -75,18 +75,18 @@ public:
 
     // iterators:
 
-    iterator       begin() noexcept;
-    const_iterator begin() const noexcept;
-    iterator       end() noexcept;
-    const_iterator end() const noexcept;
+    iterator       begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    iterator       end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND;
 
     reverse_iterator       rbegin() noexcept;
     const_reverse_iterator rbegin() const noexcept;
     reverse_iterator       rend() noexcept;
     const_reverse_iterator rend() const noexcept;
 
-    const_iterator         cbegin() const noexcept;
-    const_iterator         cend() const noexcept;
+    const_iterator         cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         cend() const noexcept _LIBCPP_LIFETIMEBOUND;
     const_reverse_iterator crbegin() const noexcept;
     const_reverse_iterator crend() const noexcept;
 
@@ -99,14 +99,14 @@ public:
     bool empty() const noexcept;
 
     // element access:
-    reference operator[](size_type i);
-    const_reference operator[](size_type i) const;
+    reference operator[](size_type i) _LIBCPP_LIFETIMEBOUND;
+    const_reference operator[](size_type i) const _LIBCPP_LIFETIMEBOUND;
     reference at(size_type i);
     const_reference at(size_type i) const;
-    reference front();
-    const_reference front() const;
-    reference back();
-    const_reference back() const;
+    reference front() _LIBCPP_LIFETIMEBOUND;
+    const_reference front() const _LIBCPP_LIFETIMEBOUND;
+    reference back() _LIBCPP_LIFETIMEBOUND;
+    const_reference back() const _LIBCPP_LIFETIMEBOUND;
 
     // modifiers:
     void push_front(const value_type& v);
@@ -117,21 +117,21 @@ public:
     void push_back(value_type&& v);
     template<container-compatible-range<T> R>
       void append_range(R&& rg); // C++23
-    template <class... Args> reference emplace_front(Args&&... args);  // reference in C++17
-    template <class... Args> reference emplace_back(Args&&... args);   // reference in C++17
-    template <class... Args> iterator emplace(const_iterator p, Args&&... args);
-    iterator insert(const_iterator p, const value_type& v);
-    iterator insert(const_iterator p, value_type&& v);
-    iterator insert(const_iterator p, size_type n, const value_type& v);
+    template <class... Args> reference emplace_front(Args&&... args) _LIBCPP_LIFETIMEBOUND;  // reference in C++17
+    template <class... Args> reference emplace_back(Args&&... args) _LIBCPP_LIFETIMEBOUND;   // reference in C++17
+    template <class... Args> iterator emplace(const_iterator p, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator p, const value_type& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator p, value_type&& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator p, size_type n, const value_type& v) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
-        iterator insert(const_iterator p, InputIterator f, InputIterator l);
+        iterator insert(const_iterator p, InputIterator f, InputIterator l) _LIBCPP_LIFETIMEBOUND;
     template<container-compatible-range<T> R>
-      iterator insert_range(const_iterator position, R&& rg); // C++23
-    iterator insert(const_iterator p, initializer_list<value_type> il);
+      iterator insert_range(const_iterator position, R&& rg) _LIBCPP_LIFETIMEBOUND; // C++23
+    iterator insert(const_iterator p, initializer_list<value_type> il) _LIBCPP_LIFETIMEBOUND;
     void pop_front();
     void pop_back();
-    iterator erase(const_iterator p);
-    iterator erase(const_iterator f, const_iterator l);
+    iterator erase(const_iterator p) _LIBCPP_LIFETIMEBOUND;
+    iterator erase(const_iterator f, const_iterator l) _LIBCPP_LIFETIMEBOUND;
     void swap(deque& c)
         noexcept(allocator_traits<allocator_type>::is_always_equal::value);  // C++17
     void clear() noexcept;
@@ -385,7 +385,7 @@ public:
     return 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI reference operator[](difference_type __n) const { return *(*this + __n); }
+  _LIBCPP_HIDE_FROM_ABI reference operator[](difference_type __n) const _LIBCPP_LIFETIMEBOUND { return *(*this + __n); }
 
   _LIBCPP_HIDE_FROM_ABI friend bool operator==(const __deque_iterator& __x, const __deque_iterator& __y) {
     return __x.__ptr_ == __y.__ptr_;
@@ -710,23 +710,23 @@ public:
 
   // iterators:
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     __map_pointer __mp = __map_.begin() + __start_ / __block_size;
     return iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
   }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __start_ / __block_size);
     return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     size_type __p      = size() + __start_;
     __map_pointer __mp = __map_.begin() + __p / __block_size;
     return iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
   }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     size_type __p            = size() + __start_;
     __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __p / __block_size);
     return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
@@ -737,8 +737,8 @@ public:
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return const_reverse_iterator(begin()); }
 
@@ -757,14 +757,14 @@ public:
   [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; }
 
   // element access:
-  _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __i) _NOEXCEPT;
-  _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __i) const _NOEXCEPT;
+  _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __i) _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __i) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
   _LIBCPP_HIDE_FROM_ABI reference at(size_type __i);
   _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __i) const;
-  _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT;
-  _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT;
-  _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT;
-  _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT;
+  _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
 
   // 23.2.2.3 modifiers:
   _LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v);
@@ -772,9 +772,9 @@ public:
 #ifndef _LIBCPP_CXX03_LANG
 #  if _LIBCPP_STD_VER >= 17
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
+  _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args) _LIBCPP_LIFETIMEBOUND;
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI reference emplace_back(_Args&&... __args);
+  _LIBCPP_HIDE_FROM_ABI reference emplace_back(_Args&&... __args) _LIBCPP_LIFETIMEBOUND;
 #  else
   template <class... _Args>
   _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
@@ -782,7 +782,7 @@ public:
   _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
 #  endif
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args);
+  _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v);
   _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __v);
@@ -799,25 +799,25 @@ public:
   }
 #  endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v);
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) _LIBCPP_LIFETIMEBOUND;
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, initializer_list<value_type> __il) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, initializer_list<value_type> __il) _LIBCPP_LIFETIMEBOUND {
     return insert(__p, __il.begin(), __il.end());
   }
 #endif // _LIBCPP_CXX03_LANG
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v);
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __v);
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __v) _LIBCPP_LIFETIMEBOUND;
   template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InputIter __f, _InputIter __l);
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InputIter __f, _InputIter __l) _LIBCPP_LIFETIMEBOUND;
   template <class _ForwardIterator,
             __enable_if_t<__has_exactly_forward_iterator_category<_ForwardIterator>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l);
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l) _LIBCPP_LIFETIMEBOUND;
   template <class _BiIter, __enable_if_t<__has_bidirectional_iterator_category<_BiIter>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _BiIter __f, _BiIter __l);
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _BiIter __f, _BiIter __l) _LIBCPP_LIFETIMEBOUND;
 
 #if _LIBCPP_STD_VER >= 23
   template <_ContainerCompatibleRange<_Tp> _Range>
-  _LIBCPP_HIDE_FROM_ABI iterator insert_range(const_iterator __position, _Range&& __range) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
     if constexpr (ranges::bidirectional_range<_Range>) {
       auto __n = static_cast<size_type>(ranges::distance(__range));
       return __insert_bidirectional(__position, ranges::begin(__range), ranges::end(__range), __n);
@@ -834,8 +834,8 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI void pop_front();
   _LIBCPP_HIDE_FROM_ABI void pop_back();
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l);
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_HIDE_FROM_ABI void swap(deque& __c)
 #if _LIBCPP_STD_VER >= 14
diff --git a/libcxx/include/experimental/__simd/simd.h b/libcxx/include/experimental/__simd/simd.h
index 2c65d19e67b36f..4cea6361405410 100644
--- a/libcxx/include/experimental/__simd/simd.h
+++ b/libcxx/include/experimental/__simd/simd.h
@@ -83,7 +83,7 @@ class simd {
   }
 
   // scalar access [simd.subscr]
-  _LIBCPP_HIDE_FROM_ABI reference operator[](size_t __i) noexcept { return reference(__s_, __i); }
+  _LIBCPP_HIDE_FROM_ABI reference operator[](size_t __i) noexcept _LIBCPP_LIFETIMEBOUND { return reference(__s_, __i); }
   _LIBCPP_HIDE_FROM_ABI value_type operator[](size_t __i) const noexcept { return __s_.__get(__i); }
 };
 
diff --git a/libcxx/include/experimental/__simd/simd_mask.h b/libcxx/include/experimental/__simd/simd_mask.h
index 55273194153134..bff3d777d61f1d 100644
--- a/libcxx/include/experimental/__simd/simd_mask.h
+++ b/libcxx/include/experimental/__simd/simd_mask.h
@@ -71,7 +71,7 @@ class simd_mask {
   }
 
   // scalar access [simd.mask.subscr]
-  _LIBCPP_HIDE_FROM_ABI reference operator[](size_t __i) noexcept { return reference(__s_, __i); }
+  _LIBCPP_HIDE_FROM_ABI reference operator[](size_t __i) noexcept _LIBCPP_LIFETIMEBOUND { return reference(__s_, __i); }
   _LIBCPP_HIDE_FROM_ABI value_type operator[](size_t __i) const noexcept { return __s_.__get(__i); }
 };
 
diff --git a/libcxx/include/experimental/memory b/libcxx/include/experimental/memory
index bf8a154690af01..26afcdddcd7c3b 100644
--- a/libcxx/include/experimental/memory
+++ b/libcxx/include/experimental/memory
@@ -32,7 +32,7 @@ public:
     template <class W2> constexpr observer_ptr(observer_ptr<W2>) noexcept;
 
     // observers
-    constexpr pointer get() const noexcept;
+    constexpr pointer get() const noexcept _LIBCPP_LIFETIMEBOUND;
     constexpr reference operator*() const;
     constexpr pointer operator->() const noexcept;
     constexpr explicit operator bool() const noexcept;
diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map
index 7b5b31c4081788..7e6168868a117f 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -60,12 +60,12 @@ public:
     size_type size() const;
     size_type max_size() const;
 
-    iterator       begin();
-    iterator       end();
-    const_iterator begin()  const;
-    const_iterator end()    const;
+    iterator       begin() _LIBCPP_LIFETIMEBOUND;
+    iterator       end() _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin()  const _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()    const _LIBCPP_LIFETIMEBOUND;
 
-    pair<iterator, bool> insert(const value_type& obj);
+    pair<iterator, bool> insert(const value_type& obj) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
 
@@ -79,13 +79,13 @@ public:
     hasher hash_funct() const;
     key_equal key_eq() const;
 
-    iterator       find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+    iterator       find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     size_type count(const key_type& k) const;
-    pair<iterator, iterator>             equal_range(const key_type& k);
-    pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+    pair<iterator, iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator, const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
 
-    mapped_type& operator[](const key_type& k);
+    mapped_type& operator[](const key_type& k) _LIBCPP_LIFETIMEBOUND;
 
     size_type bucket_count() const;
     size_type max_bucket_count() const;
@@ -150,12 +150,12 @@ public:
     size_type size() const;
     size_type max_size() const;
 
-    iterator       begin();
-    iterator       end();
-    const_iterator begin()  const;
-    const_iterator end()    const;
+    iterator       begin() _LIBCPP_LIFETIMEBOUND;
+    iterator       end() _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin()  const _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()    const _LIBCPP_LIFETIMEBOUND;
 
-    iterator insert(const value_type& obj);
+    iterator insert(const value_type& obj) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
 
@@ -169,11 +169,11 @@ public:
     hasher hash_funct() const;
     key_equal key_eq() const;
 
-    iterator       find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+    iterator       find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     size_type count(const key_type& k) const;
-    pair<iterator, iterator>             equal_range(const key_type& k);
-    pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+    pair<iterator, iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator, const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
 
     size_type bucket_count() const;
     size_type max_bucket_count() const;
@@ -511,15 +511,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type size() const { return __table_.size(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const { return __table_.max_size(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
 
-  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, bool> insert(const value_type& __x) {
+  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, bool> insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_unique(__x);
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x).first; }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x).first; }
   template <class _InputIterator>
   _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
 
@@ -535,17 +535,17 @@ public:
   _LIBCPP_HIDE_FROM_ABI hasher hash_funct() const { return __table_.hash_function().hash_function(); }
   _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq().key_eq(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
   _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_unique(__k); }
-  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
 
-  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);
+  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_HIDE_FROM_ABI size_type bucket_count() const { return __table_.bucket_count(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const { return __table_.max_bucket_count(); }
@@ -736,13 +736,13 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type size() const { return __table_.size(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const { return __table_.max_size(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__insert_multi(__x); }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_multi(__x); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x); }
   template <class _InputIterator>
   _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
 
@@ -758,13 +758,13 @@ public:
   _LIBCPP_HIDE_FROM_ABI hasher hash_funct() const { return __table_.hash_function().hash_function(); }
   _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq().key_eq(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
   _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_multi(__k); }
-  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
 
diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set
index 1ab259b59979f3..e8f44ee580021e 100644
--- a/libcxx/include/ext/hash_set
+++ b/libcxx/include/ext/hash_set
@@ -56,12 +56,12 @@ public:
     size_type size() const;
     size_type max_size() const;
 
-    iterator       begin();
-    iterator       end();
-    const_iterator begin()  const;
-    const_iterator end()    const;
+    iterator       begin() _LIBCPP_LIFETIMEBOUND;
+    iterator       end() _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin()  const _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()    const _LIBCPP_LIFETIMEBOUND;
 
-    pair<iterator, bool> insert(const value_type& obj);
+    pair<iterator, bool> insert(const value_type& obj) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
 
@@ -75,11 +75,11 @@ public:
     hasher hash_funct() const;
     key_equal key_eq() const;
 
-    iterator       find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+    iterator       find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     size_type count(const key_type& k) const;
-    pair<iterator, iterator>             equal_range(const key_type& k);
-    pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+    pair<iterator, iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator, const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
 
     size_type bucket_count() const;
     size_type max_bucket_count() const;
@@ -142,12 +142,12 @@ public:
     size_type size() const;
     size_type max_size() const;
 
-    iterator       begin();
-    iterator       end();
-    const_iterator begin()  const;
-    const_iterator end()    const;
+    iterator       begin() _LIBCPP_LIFETIMEBOUND;
+    iterator       end() _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin()  const _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()    const _LIBCPP_LIFETIMEBOUND;
 
-    iterator insert(const value_type& obj);
+    iterator insert(const value_type& obj) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
 
@@ -161,11 +161,11 @@ public:
     hasher hash_funct() const;
     key_equal key_eq() const;
 
-    iterator       find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+    iterator       find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     size_type count(const key_type& k) const;
-    pair<iterator, iterator>             equal_range(const key_type& k);
-    pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+    pair<iterator, iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator, const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
 
     size_type bucket_count() const;
     size_type max_bucket_count() const;
@@ -270,15 +270,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type size() const { return __table_.size(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const { return __table_.max_size(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
 
-  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, bool> insert(const value_type& __x) {
+  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, bool> insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_unique(__x);
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x).first; }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x).first; }
   template <class _InputIterator>
   _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
 
@@ -292,13 +292,13 @@ public:
   _LIBCPP_HIDE_FROM_ABI hasher hash_funct() const { return __table_.hash_function(); }
   _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
   _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_unique(__k); }
-  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
 
@@ -450,13 +450,13 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type size() const { return __table_.size(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const { return __table_.max_size(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__insert_multi(__x); }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_multi(__x); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x); }
   template <class _InputIterator>
   _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
 
@@ -470,13 +470,13 @@ public:
   _LIBCPP_HIDE_FROM_ABI hasher hash_funct() const { return __table_.hash_function(); }
   _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
   _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __table_.__count_multi(__k); }
-  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI std::pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
 
diff --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index 6ea04df0a089b0..623fd3d11de8cd 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -145,8 +145,8 @@
         class iterator;
         using const_iterator = iterator;
 
-        iterator begin() const;
-        iterator end() const;
+        iterator begin() const _LIBCPP_LIFETIMEBOUND;
+        iterator end() const _LIBCPP_LIFETIMEBOUND;
 
         template<class charT, class traits>
           friend basic_ostream<charT, traits>&
@@ -271,8 +271,8 @@
   };
 
     // enable directory_iterator range-based for statements
-    directory_iterator begin(directory_iterator iter) noexcept;
-    directory_iterator end(directory_iterator) noexcept;
+    directory_iterator begin(directory_iterator iter) noexcept _LIBCPP_LIFETIMEBOUND;
+    directory_iterator end(directory_iterator) noexcept _LIBCPP_LIFETIMEBOUND;
 
 class recursive_directory_iterator {
   public:
@@ -322,8 +322,8 @@ class recursive_directory_iterator {
   };
 
     // enable recursive_directory_iterator range-based for statements
-    recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
-    recursive_directory_iterator end(recursive_directory_iterator) noexcept;
+    recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept _LIBCPP_LIFETIMEBOUND;
+    recursive_directory_iterator end(recursive_directory_iterator) noexcept _LIBCPP_LIFETIMEBOUND;
 
   class file_status {
   public:
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index d3262fb8eaed1f..826813f3915922 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -72,25 +72,25 @@ public:
 
     allocator_type get_allocator() const noexcept;
 
-    iterator       begin() noexcept;
-    const_iterator begin() const noexcept;
-    iterator       end() noexcept;
-    const_iterator end() const noexcept;
+    iterator       begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    iterator       end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND;
 
-    const_iterator cbegin() const noexcept;
-    const_iterator cend() const noexcept;
+    const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cend() const noexcept _LIBCPP_LIFETIMEBOUND;
 
-    iterator       before_begin() noexcept;
-    const_iterator before_begin() const noexcept;
-    const_iterator cbefore_begin() const noexcept;
+    iterator       before_begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator before_begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cbefore_begin() const noexcept _LIBCPP_LIFETIMEBOUND;
 
     bool empty() const noexcept;
     size_type max_size() const noexcept;
 
-    reference       front();
-    const_reference front() const;
+    reference       front() _LIBCPP_LIFETIMEBOUND;
+    const_reference front() const _LIBCPP_LIFETIMEBOUND;
 
-    template <class... Args> reference emplace_front(Args&&... args);  // reference in C++17
+    template <class... Args> reference emplace_front(Args&&... args) _LIBCPP_LIFETIMEBOUND;  // reference in C++17
     void push_front(const value_type& v);
     void push_front(value_type&& v);
     template<container-compatible-range<T> R>
@@ -99,19 +99,19 @@ public:
     void pop_front();
 
     template <class... Args>
-        iterator emplace_after(const_iterator p, Args&&... args);
-    iterator insert_after(const_iterator p, const value_type& v);
-    iterator insert_after(const_iterator p, value_type&& v);
-    iterator insert_after(const_iterator p, size_type n, const value_type& v);
+        iterator emplace_after(const_iterator p, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    iterator insert_after(const_iterator p, const value_type& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert_after(const_iterator p, value_type&& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert_after(const_iterator p, size_type n, const value_type& v) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         iterator insert_after(const_iterator p,
-                              InputIterator first, InputIterator last);
+                              InputIterator first, InputIterator last) _LIBCPP_LIFETIMEBOUND;
     template<container-compatible-range<T> R>
-      iterator insert_range_after(const_iterator position, R&& rg); // C++23
-    iterator insert_after(const_iterator p, initializer_list<value_type> il);
+      iterator insert_range_after(const_iterator position, R&& rg) _LIBCPP_LIFETIMEBOUND; // C++23
+    iterator insert_after(const_iterator p, initializer_list<value_type> il) _LIBCPP_LIFETIMEBOUND;
 
-    iterator erase_after(const_iterator p);
-    iterator erase_after(const_iterator first, const_iterator last);
+    iterator erase_after(const_iterator p) _LIBCPP_LIFETIMEBOUND;
+    iterator erase_after(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
 
     void swap(forward_list& x)
         noexcept(allocator_traits<allocator_type>::is_always_equal::value);  // C++17
@@ -740,21 +740,21 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return allocator_type(base::__alloc()); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return iterator(base::__before_begin()->__next_); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(base::__before_begin()->__next_); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return const_iterator(base::__before_begin()->__next_);
   }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return iterator(nullptr); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return const_iterator(nullptr); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(nullptr); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(nullptr); }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return const_iterator(base::__before_begin()->__next_);
   }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return const_iterator(nullptr); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(nullptr); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator before_begin() _NOEXCEPT { return iterator(base::__before_begin()); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator before_begin() const _NOEXCEPT { return const_iterator(base::__before_begin()); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbefore_begin() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI iterator before_begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(base::__before_begin()); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator before_begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(base::__before_begin()); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbefore_begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return const_iterator(base::__before_begin());
   }
 
@@ -765,13 +765,13 @@ public:
     return std::min<size_type>(__node_traits::max_size(base::__alloc()), numeric_limits<difference_type>::max());
   }
 
-  _LIBCPP_HIDE_FROM_ABI reference front() { return base::__before_begin()->__next_->__get_value(); }
-  _LIBCPP_HIDE_FROM_ABI const_reference front() const { return base::__before_begin()->__next_->__get_value(); }
+  _LIBCPP_HIDE_FROM_ABI reference front() _LIBCPP_LIFETIMEBOUND { return base::__before_begin()->__next_->__get_value(); }
+  _LIBCPP_HIDE_FROM_ABI const_reference front() const _LIBCPP_LIFETIMEBOUND { return base::__before_begin()->__next_->__get_value(); }
 
 #ifndef _LIBCPP_CXX03_LANG
 #  if _LIBCPP_STD_VER >= 17
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
+  _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args) _LIBCPP_LIFETIMEBOUND;
 #  else
   template <class... _Args>
   _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
@@ -791,21 +791,21 @@ public:
 
 #ifndef _LIBCPP_CXX03_LANG
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_after(const_iterator __p, _Args&&... __args);
+  _LIBCPP_HIDE_FROM_ABI iterator emplace_after(const_iterator __p, _Args&&... __args) _LIBCPP_LIFETIMEBOUND;
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, value_type&& __v);
-  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, initializer_list<value_type> __il) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, value_type&& __v) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, initializer_list<value_type> __il) _LIBCPP_LIFETIMEBOUND {
     return insert_after(__p, __il.begin(), __il.end());
   }
 #endif // _LIBCPP_CXX03_LANG
-  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, const value_type& __v);
-  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
+  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, const value_type& __v) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, size_type __n, const value_type& __v) _LIBCPP_LIFETIMEBOUND;
   template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l);
+  _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l) _LIBCPP_LIFETIMEBOUND;
 
 #if _LIBCPP_STD_VER >= 23
   template <_ContainerCompatibleRange<_Tp> _Range>
-  _LIBCPP_HIDE_FROM_ABI iterator insert_range_after(const_iterator __position, _Range&& __range) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert_range_after(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
     return __insert_after_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
   }
 #endif
@@ -813,8 +813,8 @@ public:
   template <class _InputIterator, class _Sentinel>
   _LIBCPP_HIDE_FROM_ABI iterator __insert_after_with_sentinel(const_iterator __p, _InputIterator __f, _Sentinel __l);
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase_after(const_iterator __p);
-  _LIBCPP_HIDE_FROM_ABI iterator erase_after(const_iterator __f, const_iterator __l);
+  _LIBCPP_HIDE_FROM_ABI iterator erase_after(const_iterator __p) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI iterator erase_after(const_iterator __f, const_iterator __l) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_HIDE_FROM_ABI void swap(forward_list& __x)
 #if _LIBCPP_STD_VER >= 14
diff --git a/libcxx/include/initializer_list b/libcxx/include/initializer_list
index 680ca1cd20d550..57a05b4ae92974 100644
--- a/libcxx/include/initializer_list
+++ b/libcxx/include/initializer_list
@@ -31,12 +31,12 @@ public:
     initializer_list() noexcept; // constexpr in C++14
 
     size_t   size()  const noexcept; // constexpr in C++14
-    const E* begin() const noexcept; // constexpr in C++14
-    const E* end()   const noexcept; // constexpr in C++14
+    const E* begin() const noexcept _LIBCPP_LIFETIMEBOUND; // constexpr in C++14
+    const E* end()   const noexcept _LIBCPP_LIFETIMEBOUND; // constexpr in C++14
 };
 
-template<class E> const E* begin(initializer_list<E> il) noexcept; // constexpr in C++14
-template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in C++14
+template<class E> const E* begin(initializer_list<E> il) noexcept _LIBCPP_LIFETIMEBOUND; // constexpr in C++14
+template<class E> const E* end(initializer_list<E> il) noexcept _LIBCPP_LIFETIMEBOUND; // constexpr in C++14
 
 }  // std
 
@@ -76,18 +76,18 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t size() const _NOEXCEPT { return __size_; }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin() const _NOEXCEPT { return __begin_; }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __begin_; }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end() const _NOEXCEPT { return __begin_ + __size_; }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __begin_ + __size_; }
 };
 
 template <class _Ep>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin(initializer_list<_Ep> __il) _NOEXCEPT {
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin(initializer_list<_Ep> __il) _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
   return __il.begin();
 }
 
 template <class _Ep>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initializer_list<_Ep> __il) _NOEXCEPT {
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initializer_list<_Ep> __il) _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
   return __il.end();
 }
 
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index fca75f0a19ed1b..7905ab353e5213 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -415,7 +415,7 @@ public:
     constexpr move_iterator& operator+=(difference_type n);
     constexpr move_iterator operator-(difference_type n) const;
     constexpr move_iterator& operator-=(difference_type n);
-    constexpr reference operator[](difference_type n) const; // Return type unspecified until C++20
+    constexpr reference operator[](difference_type n) const _LIBCPP_LIFETIMEBOUND; // Return type unspecified until C++20
 
     template<sentinel_for<Iterator> S>
       friend constexpr bool
diff --git a/libcxx/include/list b/libcxx/include/list
index 4a169b08d8cddb..aad3472ee06f9c 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -73,33 +73,33 @@ public:
 
     allocator_type get_allocator() const noexcept;
 
-    iterator begin() noexcept;
-    const_iterator begin() const noexcept;
-    iterator end() noexcept;
-    const_iterator end() const noexcept;
+    iterator begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    iterator end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND;
     reverse_iterator rbegin() noexcept;
     const_reverse_iterator rbegin() const noexcept;
     reverse_iterator rend() noexcept;
     const_reverse_iterator rend() const noexcept;
-    const_iterator cbegin() const noexcept;
-    const_iterator cend() const noexcept;
+    const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cend() const noexcept _LIBCPP_LIFETIMEBOUND;
     const_reverse_iterator crbegin() const noexcept;
     const_reverse_iterator crend() const noexcept;
 
-    reference front();
-    const_reference front() const;
-    reference back();
-    const_reference back() const;
+    reference front() _LIBCPP_LIFETIMEBOUND;
+    const_reference front() const _LIBCPP_LIFETIMEBOUND;
+    reference back() _LIBCPP_LIFETIMEBOUND;
+    const_reference back() const _LIBCPP_LIFETIMEBOUND;
 
     bool empty() const noexcept;
     size_type size() const noexcept;
     size_type max_size() const noexcept;
 
     template <class... Args>
-        reference emplace_front(Args&&... args); // reference in C++17
+        reference emplace_front(Args&&... args) _LIBCPP_LIFETIMEBOUND; // reference in C++17
     void pop_front();
     template <class... Args>
-        reference emplace_back(Args&&... args);  // reference in C++17
+        reference emplace_back(Args&&... args) _LIBCPP_LIFETIMEBOUND;  // reference in C++17
     void pop_back();
     void push_front(const value_type& x);
     void push_front(value_type&& x);
@@ -110,18 +110,18 @@ public:
     template<container-compatible-range<T> R>
       void append_range(R&& rg); // C++23
     template <class... Args>
-        iterator emplace(const_iterator position, Args&&... args);
-    iterator insert(const_iterator position, const value_type& x);
-    iterator insert(const_iterator position, value_type&& x);
-    iterator insert(const_iterator position, size_type n, const value_type& x);
+        iterator emplace(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, const value_type& x) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, value_type&& x) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, size_type n, const value_type& x) _LIBCPP_LIFETIMEBOUND;
     template <class Iter>
-        iterator insert(const_iterator position, Iter first, Iter last);
+        iterator insert(const_iterator position, Iter first, Iter last) _LIBCPP_LIFETIMEBOUND;
     template<container-compatible-range<T> R>
-      iterator insert_range(const_iterator position, R&& rg); // C++23
-    iterator insert(const_iterator position, initializer_list<value_type> il);
+      iterator insert_range(const_iterator position, R&& rg) _LIBCPP_LIFETIMEBOUND; // C++23
+    iterator insert(const_iterator position, initializer_list<value_type> il) _LIBCPP_LIFETIMEBOUND;
 
-    iterator erase(const_iterator position);
-    iterator erase(const_iterator position, const_iterator last);
+    iterator erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator erase(const_iterator position, const_iterator last) _LIBCPP_LIFETIMEBOUND;
 
     void resize(size_type sz);
     void resize(size_type sz, const value_type& c);
@@ -524,10 +524,10 @@ protected:
   _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
   _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __sz() == 0; }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return iterator(__end_.__next_); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return const_iterator(__end_.__next_); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return iterator(__end_as_link()); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return const_iterator(__end_as_link()); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(__end_.__next_); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(__end_.__next_); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(__end_as_link()); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(__end_as_link()); }
 
   _LIBCPP_HIDE_FROM_ABI void swap(__list_imp& __c)
 #if _LIBCPP_STD_VER >= 14
@@ -763,12 +763,12 @@ public:
     return std::min<size_type>(base::__node_alloc_max_size(), numeric_limits<difference_type >::max());
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return base::begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return base::begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return base::end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return base::end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return base::begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return base::end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return base::begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return base::begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return base::end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return base::end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return base::begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return base::end(); }
 
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }
@@ -777,19 +777,19 @@ public:
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return const_reverse_iterator(begin()); }
 
-  _LIBCPP_HIDE_FROM_ABI reference front() {
+  _LIBCPP_HIDE_FROM_ABI reference front() _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::front called on empty list");
     return base::__end_.__next_->__as_node()->__get_value();
   }
-  _LIBCPP_HIDE_FROM_ABI const_reference front() const {
+  _LIBCPP_HIDE_FROM_ABI const_reference front() const _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::front called on empty list");
     return base::__end_.__next_->__as_node()->__get_value();
   }
-  _LIBCPP_HIDE_FROM_ABI reference back() {
+  _LIBCPP_HIDE_FROM_ABI reference back() _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::back called on empty list");
     return base::__end_.__prev_->__as_node()->__get_value();
   }
-  _LIBCPP_HIDE_FROM_ABI const_reference back() const {
+  _LIBCPP_HIDE_FROM_ABI const_reference back() const _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "list::back called on empty list");
     return base::__end_.__prev_->__as_node()->__get_value();
   }
@@ -812,22 +812,22 @@ public:
 
   template <class... _Args>
 #  if _LIBCPP_STD_VER >= 17
-  _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
+  _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args) _LIBCPP_LIFETIMEBOUND;
 #  else
   _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
 #  endif
   template <class... _Args>
 #  if _LIBCPP_STD_VER >= 17
-  _LIBCPP_HIDE_FROM_ABI reference emplace_back(_Args&&... __args);
+  _LIBCPP_HIDE_FROM_ABI reference emplace_back(_Args&&... __args) _LIBCPP_LIFETIMEBOUND;
 #  else
   _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
 #  endif
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args);
+  _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args) _LIBCPP_LIFETIMEBOUND;
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x);
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) _LIBCPP_LIFETIMEBOUND;
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, initializer_list<value_type> __il) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, initializer_list<value_type> __il) _LIBCPP_LIFETIMEBOUND {
     return insert(__p, __il.begin(), __il.end());
   }
 #endif // _LIBCPP_CXX03_LANG
@@ -844,15 +844,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI void __emplace_back(value_type const& __arg) { push_back(__arg); }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x);
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __x);
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __x) _LIBCPP_LIFETIMEBOUND;
 
   template <class _InpIter, __enable_if_t<__has_input_iterator_category<_InpIter>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InpIter __f, _InpIter __l);
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InpIter __f, _InpIter __l) _LIBCPP_LIFETIMEBOUND;
 
 #if _LIBCPP_STD_VER >= 23
   template <_ContainerCompatibleRange<_Tp> _Range>
-  _LIBCPP_HIDE_FROM_ABI iterator insert_range(const_iterator __position, _Range&& __range) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
     return __insert_with_sentinel(__position, ranges::begin(__range), ranges::end(__range));
   }
 #endif
@@ -871,8 +871,8 @@ public:
   _LIBCPP_HIDE_FROM_ABI void pop_front();
   _LIBCPP_HIDE_FROM_ABI void pop_back();
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l);
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_HIDE_FROM_ABI void resize(size_type __n);
   _LIBCPP_HIDE_FROM_ABI void resize(size_type __n, const value_type& __x);
diff --git a/libcxx/include/map b/libcxx/include/map
index fabf39512ab75f..7b9e3d2089960e 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -101,18 +101,18 @@ public:
     map& operator=(initializer_list<value_type> il);
 
     // iterators:
-          iterator begin() noexcept;
-    const_iterator begin() const noexcept;
-          iterator end() noexcept;
-    const_iterator end()   const noexcept;
+          iterator begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+          iterator end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()   const noexcept _LIBCPP_LIFETIMEBOUND;
 
           reverse_iterator rbegin() noexcept;
     const_reverse_iterator rbegin() const noexcept;
           reverse_iterator rend() noexcept;
     const_reverse_iterator rend()   const noexcept;
 
-    const_iterator         cbegin()  const noexcept;
-    const_iterator         cend()    const noexcept;
+    const_iterator         cbegin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         cend()    const noexcept _LIBCPP_LIFETIMEBOUND;
     const_reverse_iterator crbegin() const noexcept;
     const_reverse_iterator crend()   const noexcept;
 
@@ -122,25 +122,25 @@ public:
     size_type max_size() const noexcept;
 
     // element access:
-    mapped_type& operator[](const key_type& k);
-    mapped_type& operator[](key_type&& k);
+    mapped_type& operator[](const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    mapped_type& operator[](key_type&& k) _LIBCPP_LIFETIMEBOUND;
 
           mapped_type& at(const key_type& k);
     const mapped_type& at(const key_type& k) const;
 
     // modifiers:
     template <class... Args>
-        pair<iterator, bool> emplace(Args&&... args);
+        pair<iterator, bool> emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND;
     template <class... Args>
-        iterator emplace_hint(const_iterator position, Args&&... args);
-    pair<iterator, bool> insert(const value_type& v);
-    pair<iterator, bool> insert(      value_type&& v);                                // C++17
+        iterator emplace_hint(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    pair<iterator, bool> insert(const value_type& v) _LIBCPP_LIFETIMEBOUND;
+    pair<iterator, bool> insert(      value_type&& v) _LIBCPP_LIFETIMEBOUND;                                // C++17
     template <class P>
-        pair<iterator, bool> insert(P&& p);
-    iterator insert(const_iterator position, const value_type& v);
-    iterator insert(const_iterator position,       value_type&& v);                   // C++17
+        pair<iterator, bool> insert(P&& p) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, const value_type& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position,       value_type&& v) _LIBCPP_LIFETIMEBOUND;                   // C++17
     template <class P>
-        iterator insert(const_iterator position, P&& p);
+        iterator insert(const_iterator position, P&& p) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
     template<container-compatible-range<value_type> R>
@@ -150,7 +150,7 @@ public:
     node_type extract(const_iterator position);                                       // C++17
     node_type extract(const key_type& x);                                             // C++17
     insert_return_type insert(node_type&& nh);                                        // C++17
-    iterator insert(const_iterator hint, node_type&& nh);                             // C++17
+    iterator insert(const_iterator hint, node_type&& nh) _LIBCPP_LIFETIMEBOUND;                             // C++17
 
     template <class... Args>
         pair<iterator, bool> try_emplace(const key_type& k, Args&&... args);          // C++17
@@ -161,18 +161,18 @@ public:
     template <class... Args>
         iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args);      // C++17
     template <class M>
-        pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj);            // C++17
+        pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj) _LIBCPP_LIFETIMEBOUND;            // C++17
     template <class M>
-        pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj);                 // C++17
+        pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj) _LIBCPP_LIFETIMEBOUND;                 // C++17
     template <class M>
-        iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj);   // C++17
+        iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj) _LIBCPP_LIFETIMEBOUND;   // C++17
     template <class M>
-        iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj);        // C++17
+        iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj) _LIBCPP_LIFETIMEBOUND;        // C++17
 
-    iterator  erase(const_iterator position);
-    iterator  erase(iterator position); // C++14
+    iterator  erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator  erase(iterator position) _LIBCPP_LIFETIMEBOUND; // C++14
     size_type erase(const key_type& k);
-    iterator  erase(const_iterator first, const_iterator last);
+    iterator  erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
     void clear() noexcept;
 
     template<class C2>
@@ -194,12 +194,12 @@ public:
     value_compare  value_comp()    const;
 
     // map operations:
-          iterator find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+          iterator find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator find(const K& x);              // C++14
+        iterator find(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator find(const K& x) const;  // C++14
+        const_iterator find(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
     template<typename K>
       size_type count(const K& x) const;        // C++14
@@ -208,26 +208,26 @@ public:
     bool           contains(const key_type& x) const;  // C++20
     template<class K> bool contains(const K& x) const; // C++20
 
-          iterator lower_bound(const key_type& k);
-    const_iterator lower_bound(const key_type& k) const;
+          iterator lower_bound(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator lower_bound(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator lower_bound(const K& x);              // C++14
+        iterator lower_bound(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator lower_bound(const K& x) const;  // C++14
+        const_iterator lower_bound(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
-          iterator upper_bound(const key_type& k);
-    const_iterator upper_bound(const key_type& k) const;
+          iterator upper_bound(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator upper_bound(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator upper_bound(const K& x);              // C++14
+        iterator upper_bound(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator upper_bound(const K& x) const;  // C++14
+        const_iterator upper_bound(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
-    pair<iterator,iterator>             equal_range(const key_type& k);
-    pair<const_iterator,const_iterator> equal_range(const key_type& k) const;
+    pair<iterator,iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator,const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        pair<iterator,iterator>             equal_range(const K& x);        // C++14
+        pair<iterator,iterator>             equal_range(const K& x) _LIBCPP_LIFETIMEBOUND;        // C++14
     template<typename K>
-        pair<const_iterator,const_iterator> equal_range(const K& x) const;  // C++14
+        pair<const_iterator,const_iterator> equal_range(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 };
 
 template <class InputIterator,
@@ -387,18 +387,18 @@ public:
     multimap& operator=(initializer_list<value_type> il);
 
     // iterators:
-          iterator begin() noexcept;
-    const_iterator begin() const noexcept;
-          iterator end() noexcept;
-    const_iterator end()   const noexcept;
+          iterator begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+          iterator end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()   const noexcept _LIBCPP_LIFETIMEBOUND;
 
           reverse_iterator rbegin() noexcept;
     const_reverse_iterator rbegin() const noexcept;
           reverse_iterator rend() noexcept;
     const_reverse_iterator rend()   const noexcept;
 
-    const_iterator         cbegin()  const noexcept;
-    const_iterator         cend()    const noexcept;
+    const_iterator         cbegin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         cend()    const noexcept _LIBCPP_LIFETIMEBOUND;
     const_reverse_iterator crbegin() const noexcept;
     const_reverse_iterator crend()   const noexcept;
 
@@ -409,17 +409,17 @@ public:
 
     // modifiers:
     template <class... Args>
-        iterator emplace(Args&&... args);
+        iterator emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND;
     template <class... Args>
-        iterator emplace_hint(const_iterator position, Args&&... args);
-    iterator insert(const value_type& v);
-    iterator insert(      value_type&& v);                                            // C++17
+        iterator emplace_hint(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const value_type& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(      value_type&& v) _LIBCPP_LIFETIMEBOUND;                                            // C++17
     template <class P>
-        iterator insert(P&& p);
-    iterator insert(const_iterator position, const value_type& v);
-    iterator insert(const_iterator position,       value_type&& v);                   // C++17
+        iterator insert(P&& p) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, const value_type& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position,       value_type&& v) _LIBCPP_LIFETIMEBOUND;                   // C++17
     template <class P>
-        iterator insert(const_iterator position, P&& p);
+        iterator insert(const_iterator position, P&& p) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
     template<container-compatible-range<value_type> R>
@@ -428,13 +428,13 @@ public:
 
     node_type extract(const_iterator position);                                       // C++17
     node_type extract(const key_type& x);                                             // C++17
-    iterator insert(node_type&& nh);                                                  // C++17
-    iterator insert(const_iterator hint, node_type&& nh);                             // C++17
+    iterator insert(node_type&& nh) _LIBCPP_LIFETIMEBOUND;                                                  // C++17
+    iterator insert(const_iterator hint, node_type&& nh) _LIBCPP_LIFETIMEBOUND;                             // C++17
 
-    iterator  erase(const_iterator position);
-    iterator  erase(iterator position); // C++14
+    iterator  erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator  erase(iterator position) _LIBCPP_LIFETIMEBOUND; // C++14
     size_type erase(const key_type& k);
-    iterator  erase(const_iterator first, const_iterator last);
+    iterator  erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
     void clear() noexcept;
 
     template<class C2>
@@ -456,12 +456,12 @@ public:
     value_compare  value_comp()    const;
 
     // map operations:
-          iterator find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+          iterator find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator find(const K& x);              // C++14
+        iterator find(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator find(const K& x) const;  // C++14
+        const_iterator find(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
     template<typename K>
       size_type count(const K& x) const;        // C++14
@@ -470,26 +470,26 @@ public:
     bool           contains(const key_type& x) const;  // C++20
     template<class K> bool contains(const K& x) const; // C++20
 
-          iterator lower_bound(const key_type& k);
-    const_iterator lower_bound(const key_type& k) const;
+          iterator lower_bound(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator lower_bound(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator lower_bound(const K& x);              // C++14
+        iterator lower_bound(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator lower_bound(const K& x) const;  // C++14
+        const_iterator lower_bound(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
-          iterator upper_bound(const key_type& k);
-    const_iterator upper_bound(const key_type& k) const;
+          iterator upper_bound(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator upper_bound(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator upper_bound(const K& x);              // C++14
+        iterator upper_bound(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator upper_bound(const K& x) const;  // C++14
+        const_iterator upper_bound(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
-    pair<iterator,iterator>             equal_range(const key_type& k);
-    pair<const_iterator,const_iterator> equal_range(const key_type& k) const;
+    pair<iterator,iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator,const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        pair<iterator,iterator>             equal_range(const K& x);        // C++14
+        pair<iterator,iterator>             equal_range(const K& x) _LIBCPP_LIFETIMEBOUND;        // C++14
     template<typename K>
-        pair<const_iterator,const_iterator> equal_range(const K& x) const;  // C++14
+        pair<const_iterator,const_iterator> equal_range(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 };
 
 template <class InputIterator,
@@ -1137,18 +1137,18 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI ~map() { static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.end(); }
 
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
 
@@ -1156,9 +1156,9 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __tree_.size(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __tree_.max_size(); }
 
-  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);
+  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k) _LIBCPP_LIFETIMEBOUND;
 #ifndef _LIBCPP_CXX03_LANG
-  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);
+  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k) _LIBCPP_LIFETIMEBOUND;
 #endif
 
   _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);
@@ -1170,39 +1170,39 @@ public:
 
 #ifndef _LIBCPP_CXX03_LANG
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__emplace_unique(std::forward<_Args>(__args)...);
   }
 
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__emplace_hint_unique(__p.__i_, std::forward<_Args>(__args)...);
   }
 
   template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(_Pp&& __p) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(_Pp&& __p) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_unique(std::forward<_Pp>(__p));
   }
 
   template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_unique(__pos.__i_, std::forward<_Pp>(__p));
   }
 
 #endif // _LIBCPP_CXX03_LANG
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__insert_unique(__v); }
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) _LIBCPP_LIFETIMEBOUND { return __tree_.__insert_unique(__v); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_unique(__p.__i_, __v);
   }
 
 #ifndef _LIBCPP_CXX03_LANG
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __v) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_unique(std::move(__v));
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_unique(__p.__i_, std::move(__v));
   }
 
@@ -1270,7 +1270,7 @@ public:
   }
 
   template <class _Vp>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND {
     iterator __p = lower_bound(__k);
     if (__p != end() && !key_comp()(__k, __p->first)) {
       __p->second = std::forward<_Vp>(__v);
@@ -1280,7 +1280,7 @@ public:
   }
 
   template <class _Vp>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND {
     iterator __p = lower_bound(__k);
     if (__p != end() && !key_comp()(__k, __p->first)) {
       __p->second = std::forward<_Vp>(__v);
@@ -1290,7 +1290,7 @@ public:
   }
 
   template <class _Vp>
-  _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND {
     auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(__h.__i_, __k, __k, std::forward<_Vp>(__v));
 
     if (!__inserted)
@@ -1300,7 +1300,7 @@ public:
   }
 
   template <class _Vp>
-  _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND {
     auto [__r, __inserted] =
         __tree_.__emplace_hint_unique_key_args(__h.__i_, __k, std::move(__k), std::forward<_Vp>(__v));
 
@@ -1312,10 +1312,10 @@ public:
 
 #endif // _LIBCPP_STD_VER >= 17
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p.__i_); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __tree_.erase(__p.__i_); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __tree_.erase(__p.__i_); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) _LIBCPP_LIFETIMEBOUND { return __tree_.erase(__p.__i_); }
   _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_unique(__k); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) {
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) _LIBCPP_LIFETIMEBOUND {
     return __tree_.erase(__f.__i_, __l.__i_);
   }
   _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }
@@ -1326,7 +1326,7 @@ public:
                                         "node_type with incompatible allocator passed to map::insert()");
     return __tree_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to map::insert()");
     return __tree_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));
@@ -1365,15 +1365,15 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI void swap(map& __m) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__m.__tree_); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.find(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.find(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.find(__k);
   }
 #endif
@@ -1394,46 +1394,46 @@ public:
   }
 #endif // _LIBCPP_STD_VER >= 20
 
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.lower_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.lower_bound(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.lower_bound(__k);
   }
 
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.lower_bound(__k);
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.upper_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.upper_bound(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.upper_bound(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.upper_bound(__k);
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_unique(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_unique(__k);
   }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
 #endif
@@ -1825,18 +1825,18 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI ~multimap() { static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.end(); }
 
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
 
@@ -1851,28 +1851,28 @@ public:
 #ifndef _LIBCPP_CXX03_LANG
 
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__emplace_multi(std::forward<_Args>(__args)...);
   }
 
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__emplace_hint_multi(__p.__i_, std::forward<_Args>(__args)...);
   }
 
   template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(_Pp&& __p) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(_Pp&& __p) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_multi(std::forward<_Pp>(__p));
   }
 
   template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_multi(__pos.__i_, std::forward<_Pp>(__p));
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__insert_multi(std::move(__v)); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) _LIBCPP_LIFETIMEBOUND { return __tree_.__insert_multi(std::move(__v)); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_multi(__p.__i_, std::move(__v));
   }
 
@@ -1880,9 +1880,9 @@ public:
 
 #endif // _LIBCPP_CXX03_LANG
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__insert_multi(__v); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) _LIBCPP_LIFETIMEBOUND { return __tree_.__insert_multi(__v); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_multi(__p.__i_, __v);
   }
 
@@ -1902,20 +1902,20 @@ public:
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p.__i_); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __tree_.erase(__p.__i_); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __tree_.erase(__p.__i_); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) _LIBCPP_LIFETIMEBOUND { return __tree_.erase(__p.__i_); }
   _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_multi(__k); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) {
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) _LIBCPP_LIFETIMEBOUND {
     return __tree_.erase(__f.__i_, __l.__i_);
   }
 
 #if _LIBCPP_STD_VER >= 17
-  _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to multimap::insert()");
     return __tree_.template __node_handle_insert_multi<node_type>(std::move(__nh));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to multimap::insert()");
     return __tree_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));
@@ -1958,15 +1958,15 @@ public:
     __tree_.swap(__m.__tree_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.find(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.find(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.find(__k);
   }
 #endif
@@ -1987,46 +1987,46 @@ public:
   }
 #endif // _LIBCPP_STD_VER >= 20
 
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.lower_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.lower_bound(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.lower_bound(__k);
   }
 
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.lower_bound(__k);
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.upper_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.upper_bound(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.upper_bound(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.upper_bound(__k);
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
 #endif
diff --git a/libcxx/include/mdspan b/libcxx/include/mdspan
index 29190e4a9953ed..4d6d509caca960 100644
--- a/libcxx/include/mdspan
+++ b/libcxx/include/mdspan
@@ -322,7 +322,7 @@ namespace std {
 
     // [mdspan.mdspan.members], members
     template<class... OtherIndexTypes>
-      constexpr reference operator[](OtherIndexTypes... indices) const;
+      constexpr reference operator[](OtherIndexTypes... indices) const _LIBCPP_LIFETIMEBOUND;
     template<class OtherIndexType>
       constexpr reference operator[](span<OtherIndexType, rank()> indices) const;
     template<class OtherIndexType>
diff --git a/libcxx/include/memory b/libcxx/include/memory
index db3386cca48009..b0849d8624de1c 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -454,7 +454,7 @@ public:
     constexpr
     add_lvalue_reference<T>::type operator*() const noexcept(see below);              // constexpr since C++23
     constexpr pointer operator->() const noexcept;                                    // constexpr since C++23
-    constexpr pointer get() const noexcept;                                           // constexpr since C++23
+    constexpr pointer get() const noexcept _LIBCPP_LIFETIMEBOUND;                                           // constexpr since C++23
     constexpr deleter_type& get_deleter() noexcept;                                   // constexpr since C++23
     constexpr const deleter_type& get_deleter() const noexcept;                       // constexpr since C++23
     constexpr explicit operator bool() const noexcept;                                // constexpr since C++23
@@ -493,8 +493,8 @@ public:
     constexpr unique_ptr& operator=(nullptr_t) noexcept;             // constexpr since C++23
 
     // observers
-    constexpr T& operator[](size_t i) const;                    // constexpr since C++23
-    constexpr pointer get() const noexcept;                     // constexpr since C++23
+    constexpr T& operator[](size_t i) const _LIBCPP_LIFETIMEBOUND;                    // constexpr since C++23
+    constexpr pointer get() const noexcept _LIBCPP_LIFETIMEBOUND;                     // constexpr since C++23
     constexpr deleter_type& get_deleter() noexcept;             // constexpr since C++23
     constexpr const deleter_type& get_deleter() const noexcept; // constexpr since C++23
     constexpr explicit operator bool() const noexcept;          // constexpr since C++23
diff --git a/libcxx/include/optional b/libcxx/include/optional
index b9dcf9053633f0..4d9d03046480aa 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -129,8 +129,8 @@ namespace std {
     template<class U = T> optional &operator=(U &&);                              // constexpr in C++20
     template<class U> optional &operator=(const optional<U> &);                   // constexpr in C++20
     template<class U> optional &operator=(optional<U> &&);                        // constexpr in C++20
-    template<class... Args> T& emplace(Args &&...);                               // constexpr in C++20
-    template<class U, class... Args> T& emplace(initializer_list<U>, Args &&...); // constexpr in C++20
+    template<class... Args> T& emplace(Args &&...) _LIBCPP_LIFETIMEBOUND;                               // constexpr in C++20
+    template<class U, class... Args> T& emplace(initializer_list<U>, Args &&...) _LIBCPP_LIFETIMEBOUND; // constexpr in C++20
 
     // [optional.swap], swap
     void swap(optional &) noexcept(see below ); // constexpr in C++20
@@ -757,7 +757,7 @@ public:
   }
 
   template <class... _Args, class = enable_if_t< is_constructible_v<value_type, _Args...> > >
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     reset();
     this->__construct(std::forward<_Args>(__args)...);
     return this->__get();
@@ -766,7 +766,7 @@ public:
   template <class _Up,
             class... _Args,
             class = enable_if_t< is_constructible_v<value_type, initializer_list<_Up>&, _Args...> > >
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     reset();
     this->__construct(__il, std::forward<_Args>(__args)...);
     return this->__get();
diff --git a/libcxx/include/queue b/libcxx/include/queue
index db9ad26eaeddfb..02e8caf11416f0 100644
--- a/libcxx/include/queue
+++ b/libcxx/include/queue
@@ -62,16 +62,16 @@ public:
     bool      empty() const;
     size_type size() const;
 
-    reference       front();
-    const_reference front() const;
-    reference       back();
-    const_reference back() const;
+    reference       front() _LIBCPP_LIFETIMEBOUND;
+    const_reference front() const _LIBCPP_LIFETIMEBOUND;
+    reference       back() _LIBCPP_LIFETIMEBOUND;
+    const_reference back() const _LIBCPP_LIFETIMEBOUND;
 
     void push(const value_type& v);
     void push(value_type&& v);
     template<container-compatible-range<T> R>
       void push_range(R&& rg); // C++23
-    template <class... Args> reference emplace(Args&&... args); // reference in C++17
+    template <class... Args> reference emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND; // reference in C++17
     void pop();
 
     void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>)
@@ -375,10 +375,10 @@ public:
   [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const { return c.empty(); }
   _LIBCPP_HIDE_FROM_ABI size_type size() const { return c.size(); }
 
-  _LIBCPP_HIDE_FROM_ABI reference front() { return c.front(); }
-  _LIBCPP_HIDE_FROM_ABI const_reference front() const { return c.front(); }
-  _LIBCPP_HIDE_FROM_ABI reference back() { return c.back(); }
-  _LIBCPP_HIDE_FROM_ABI const_reference back() const { return c.back(); }
+  _LIBCPP_HIDE_FROM_ABI reference front() _LIBCPP_LIFETIMEBOUND { return c.front(); }
+  _LIBCPP_HIDE_FROM_ABI const_reference front() const _LIBCPP_LIFETIMEBOUND { return c.front(); }
+  _LIBCPP_HIDE_FROM_ABI reference back() _LIBCPP_LIFETIMEBOUND { return c.back(); }
+  _LIBCPP_HIDE_FROM_ABI const_reference back() const _LIBCPP_LIFETIMEBOUND { return c.back(); }
 
   _LIBCPP_HIDE_FROM_ABI void push(const value_type& __v) { c.push_back(__v); }
 #ifndef _LIBCPP_CXX03_LANG
diff --git a/libcxx/include/regex b/libcxx/include/regex
index 074b19865cb4ff..cdb964cd2e2718 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -498,15 +498,15 @@ public:
     difference_type length(size_type sub = 0) const;
     difference_type position(size_type sub = 0) const;
     string_type str(size_type sub = 0) const;
-    const_reference operator[](size_type n) const;
+    const_reference operator[](size_type n) const _LIBCPP_LIFETIMEBOUND;
 
     const_reference prefix() const;
     const_reference suffix() const;
 
-    const_iterator begin() const;
-    const_iterator end() const;
-    const_iterator cbegin() const;
-    const_iterator cend() const;
+    const_iterator begin() const _LIBCPP_LIFETIMEBOUND;
+    const_iterator end() const _LIBCPP_LIFETIMEBOUND;
+    const_iterator cbegin() const _LIBCPP_LIFETIMEBOUND;
+    const_iterator cend() const _LIBCPP_LIFETIMEBOUND;
 
     // format:
     template <class OutputIter>
@@ -4596,7 +4596,7 @@ public:
     _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::str() called when not ready");
     return (*this)[__sub].str();
   }
-  _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __n) const {
+  _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __n) const _LIBCPP_LIFETIMEBOUND {
     // If the match results are not ready, this call will be equivalent to calling this function with `__n >= size()`,
     // returning an empty subrange.
     _LIBCPP_ASSERT_PEDANTIC(ready(), "match_results::operator[]() called when not ready");
@@ -4614,10 +4614,10 @@ public:
     return __suffix_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const { return empty() ? __matches_.end() : __matches_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __matches_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const { return empty() ? __matches_.end() : __matches_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const { return __matches_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _LIBCPP_LIFETIMEBOUND { return empty() ? __matches_.end() : __matches_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _LIBCPP_LIFETIMEBOUND { return __matches_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _LIBCPP_LIFETIMEBOUND { return empty() ? __matches_.end() : __matches_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _LIBCPP_LIFETIMEBOUND { return __matches_.end(); }
 
   // format:
   template <class _OutputIter>
diff --git a/libcxx/include/set b/libcxx/include/set
index 5db0db8086dec6..be1d2814b71018 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -88,18 +88,18 @@ public:
     set& operator=(initializer_list<value_type> il);
 
     // iterators:
-          iterator begin() noexcept;
-    const_iterator begin() const noexcept;
-          iterator end() noexcept;
-    const_iterator end()   const noexcept;
+          iterator begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+          iterator end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()   const noexcept _LIBCPP_LIFETIMEBOUND;
 
           reverse_iterator rbegin() noexcept;
     const_reverse_iterator rbegin() const noexcept;
           reverse_iterator rend() noexcept;
     const_reverse_iterator rend()   const noexcept;
 
-    const_iterator         cbegin()  const noexcept;
-    const_iterator         cend()    const noexcept;
+    const_iterator         cbegin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         cend()    const noexcept _LIBCPP_LIFETIMEBOUND;
     const_reverse_iterator crbegin() const noexcept;
     const_reverse_iterator crend()   const noexcept;
 
@@ -110,13 +110,13 @@ public:
 
     // modifiers:
     template <class... Args>
-        pair<iterator, bool> emplace(Args&&... args);
+        pair<iterator, bool> emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND;
     template <class... Args>
-        iterator emplace_hint(const_iterator position, Args&&... args);
+        iterator emplace_hint(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
     pair<iterator,bool> insert(const value_type& v);
     pair<iterator,bool> insert(value_type&& v);
-    iterator insert(const_iterator position, const value_type& v);
-    iterator insert(const_iterator position, value_type&& v);
+    iterator insert(const_iterator position, const value_type& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, value_type&& v) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
     template<container-compatible-range<value_type> R>
@@ -126,12 +126,12 @@ public:
     node_type extract(const_iterator position);                                       // C++17
     node_type extract(const key_type& x);                                             // C++17
     insert_return_type insert(node_type&& nh);                                        // C++17
-    iterator insert(const_iterator hint, node_type&& nh);                             // C++17
+    iterator insert(const_iterator hint, node_type&& nh) _LIBCPP_LIFETIMEBOUND;                             // C++17
 
-    iterator  erase(const_iterator position);
-    iterator  erase(iterator position);  // C++14
+    iterator  erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator  erase(iterator position) _LIBCPP_LIFETIMEBOUND;  // C++14
     size_type erase(const key_type& k);
-    iterator  erase(const_iterator first, const_iterator last);
+    iterator  erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
     void clear() noexcept;
 
     template<class C2>
@@ -155,12 +155,12 @@ public:
     value_compare  value_comp()    const;
 
     // set operations:
-          iterator find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+          iterator find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator find(const K& x);
+        iterator find(const K& x) _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        const_iterator find(const K& x) const;  // C++14
+        const_iterator find(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
     template<typename K>
         size_type count(const K& x) const;        // C++14
@@ -169,25 +169,25 @@ public:
     bool           contains(const key_type& x) const;  // C++20
     template<class K> bool contains(const K& x) const; // C++20
 
-          iterator lower_bound(const key_type& k);
-    const_iterator lower_bound(const key_type& k) const;
+          iterator lower_bound(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator lower_bound(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator lower_bound(const K& x);              // C++14
+        iterator lower_bound(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator lower_bound(const K& x) const;  // C++14
+        const_iterator lower_bound(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
-          iterator upper_bound(const key_type& k);
-    const_iterator upper_bound(const key_type& k) const;
+          iterator upper_bound(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator upper_bound(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator upper_bound(const K& x);              // C++14
+        iterator upper_bound(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator upper_bound(const K& x) const;  // C++14
-    pair<iterator,iterator>             equal_range(const key_type& k);
-    pair<const_iterator,const_iterator> equal_range(const key_type& k) const;
+        const_iterator upper_bound(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
+    pair<iterator,iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator,const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        pair<iterator,iterator>             equal_range(const K& x);        // C++14
+        pair<iterator,iterator>             equal_range(const K& x) _LIBCPP_LIFETIMEBOUND;        // C++14
     template<typename K>
-        pair<const_iterator,const_iterator> equal_range(const K& x) const;  // C++14
+        pair<const_iterator,const_iterator> equal_range(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 };
 
 template <class InputIterator,
@@ -333,18 +333,18 @@ public:
     multiset& operator=(initializer_list<value_type> il);
 
     // iterators:
-          iterator begin() noexcept;
-    const_iterator begin() const noexcept;
-          iterator end() noexcept;
-    const_iterator end()   const noexcept;
+          iterator begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+          iterator end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()   const noexcept _LIBCPP_LIFETIMEBOUND;
 
           reverse_iterator rbegin() noexcept;
     const_reverse_iterator rbegin() const noexcept;
           reverse_iterator rend() noexcept;
     const_reverse_iterator rend()   const noexcept;
 
-    const_iterator         cbegin()  const noexcept;
-    const_iterator         cend()    const noexcept;
+    const_iterator         cbegin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         cend()    const noexcept _LIBCPP_LIFETIMEBOUND;
     const_reverse_iterator crbegin() const noexcept;
     const_reverse_iterator crend()   const noexcept;
 
@@ -355,13 +355,13 @@ public:
 
     // modifiers:
     template <class... Args>
-        iterator emplace(Args&&... args);
+        iterator emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND;
     template <class... Args>
-        iterator emplace_hint(const_iterator position, Args&&... args);
-    iterator insert(const value_type& v);
-    iterator insert(value_type&& v);
-    iterator insert(const_iterator position, const value_type& v);
-    iterator insert(const_iterator position, value_type&& v);
+        iterator emplace_hint(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const value_type& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(value_type&& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, const value_type& v) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, value_type&& v) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
     template<container-compatible-range<value_type> R>
@@ -370,13 +370,13 @@ public:
 
     node_type extract(const_iterator position);                                       // C++17
     node_type extract(const key_type& x);                                             // C++17
-    iterator insert(node_type&& nh);                                                  // C++17
-    iterator insert(const_iterator hint, node_type&& nh);                             // C++17
+    iterator insert(node_type&& nh) _LIBCPP_LIFETIMEBOUND;                                                  // C++17
+    iterator insert(const_iterator hint, node_type&& nh) _LIBCPP_LIFETIMEBOUND;                             // C++17
 
-    iterator  erase(const_iterator position);
-    iterator  erase(iterator position);  // C++14
+    iterator  erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator  erase(iterator position) _LIBCPP_LIFETIMEBOUND;  // C++14
     size_type erase(const key_type& k);
-    iterator  erase(const_iterator first, const_iterator last);
+    iterator  erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
     void clear() noexcept;
 
     template<class C2>
@@ -400,12 +400,12 @@ public:
     value_compare  value_comp()    const;
 
     // set operations:
-          iterator find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+          iterator find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator find(const K& x);
+        iterator find(const K& x) _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        const_iterator find(const K& x) const;  // C++14
+        const_iterator find(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
     template<typename K>
         size_type count(const K& x) const;      // C++14
@@ -414,26 +414,26 @@ public:
     bool           contains(const key_type& x) const;  // C++20
     template<class K> bool contains(const K& x) const; // C++20
 
-          iterator lower_bound(const key_type& k);
-    const_iterator lower_bound(const key_type& k) const;
+          iterator lower_bound(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator lower_bound(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator lower_bound(const K& x);              // C++14
+        iterator lower_bound(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator lower_bound(const K& x) const;  // C++14
+        const_iterator lower_bound(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
-          iterator upper_bound(const key_type& k);
-    const_iterator upper_bound(const key_type& k) const;
+          iterator upper_bound(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator upper_bound(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator upper_bound(const K& x);              // C++14
+        iterator upper_bound(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++14
     template<typename K>
-        const_iterator upper_bound(const K& x) const;  // C++14
+        const_iterator upper_bound(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 
-    pair<iterator,iterator>             equal_range(const key_type& k);
-    pair<const_iterator,const_iterator> equal_range(const key_type& k) const;
+    pair<iterator,iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator,const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        pair<iterator,iterator>             equal_range(const K& x);        // C++14
+        pair<iterator,iterator>             equal_range(const K& x) _LIBCPP_LIFETIMEBOUND;        // C++14
     template<typename K>
-        pair<const_iterator,const_iterator> equal_range(const K& x) const;  // C++14
+        pair<const_iterator,const_iterator> equal_range(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++14
 };
 
 template <class InputIterator,
@@ -708,18 +708,18 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI ~set() { static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.end(); }
 
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
 
@@ -730,17 +730,17 @@ public:
   // modifiers:
 #ifndef _LIBCPP_CXX03_LANG
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__emplace_unique(std::forward<_Args>(__args)...);
   }
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__emplace_hint_unique(__p, std::forward<_Args>(__args)...);
   }
 #endif // _LIBCPP_CXX03_LANG
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) { return __tree_.__insert_unique(__v); }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __v) _LIBCPP_LIFETIMEBOUND { return __tree_.__insert_unique(__v); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_unique(__p, __v);
   }
 
@@ -761,20 +761,20 @@ public:
 #endif
 
 #ifndef _LIBCPP_CXX03_LANG
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __v) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_unique(std::move(__v));
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_unique(__p, std::move(__v));
   }
 
   _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
 #endif // _LIBCPP_CXX03_LANG
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __tree_.erase(__p); }
   _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_unique(__k); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) { return __tree_.erase(__f, __l); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) _LIBCPP_LIFETIMEBOUND { return __tree_.erase(__f, __l); }
   _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }
 
 #if _LIBCPP_STD_VER >= 17
@@ -783,7 +783,7 @@ public:
                                         "node_type with incompatible allocator passed to set::insert()");
     return __tree_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to set::insert()");
     return __tree_.template __node_handle_insert_unique<node_type>(__hint, std::move(__nh));
@@ -827,15 +827,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __tree_.value_comp(); }
 
   // set operations:
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.find(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.find(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.find(__k);
   }
 #endif
@@ -856,46 +856,46 @@ public:
   }
 #endif // _LIBCPP_STD_VER >= 20
 
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.lower_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.lower_bound(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.lower_bound(__k);
   }
 
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.lower_bound(__k);
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.upper_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.upper_bound(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.upper_bound(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.upper_bound(__k);
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_unique(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_unique(__k);
   }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
 #endif
@@ -1173,18 +1173,18 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI ~multiset() { static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __tree_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __tree_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __tree_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __tree_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __tree_.end(); }
 
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }
   _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return rbegin(); }
   _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
 
@@ -1195,17 +1195,17 @@ public:
   // modifiers:
 #ifndef _LIBCPP_CXX03_LANG
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__emplace_multi(std::forward<_Args>(__args)...);
   }
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__emplace_hint_multi(__p, std::forward<_Args>(__args)...);
   }
 #endif // _LIBCPP_CXX03_LANG
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__insert_multi(__v); }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) _LIBCPP_LIFETIMEBOUND { return __tree_.__insert_multi(__v); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_multi(__p, __v);
   }
 
@@ -1226,27 +1226,27 @@ public:
 #endif
 
 #ifndef _LIBCPP_CXX03_LANG
-  _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__insert_multi(std::move(__v)); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) _LIBCPP_LIFETIMEBOUND { return __tree_.__insert_multi(std::move(__v)); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__insert_multi(__p, std::move(__v));
   }
 
   _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
 #endif // _LIBCPP_CXX03_LANG
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __tree_.erase(__p); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __tree_.erase(__p); }
   _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __tree_.__erase_multi(__k); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) { return __tree_.erase(__f, __l); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l) _LIBCPP_LIFETIMEBOUND { return __tree_.erase(__f, __l); }
   _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __tree_.clear(); }
 
 #if _LIBCPP_STD_VER >= 17
-  _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to multiset::insert()");
     return __tree_.template __node_handle_insert_multi<node_type>(std::move(__nh));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to multiset::insert()");
     return __tree_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));
@@ -1292,15 +1292,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __tree_.value_comp(); }
 
   // set operations:
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.find(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.find(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.find(__k);
   }
 #endif
@@ -1321,46 +1321,46 @@ public:
   }
 #endif // _LIBCPP_STD_VER >= 20
 
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.lower_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.lower_bound(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.lower_bound(__k);
   }
 
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.lower_bound(__k);
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.upper_bound(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.upper_bound(__k); }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.upper_bound(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.upper_bound(__k);
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
 #if _LIBCPP_STD_VER >= 14
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
   template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __tree_.__equal_range_multi(__k);
   }
 #endif
diff --git a/libcxx/include/span b/libcxx/include/span
index a32f7a372e2ae1..52321ad8414075 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -106,15 +106,15 @@ public:
     [[nodiscard]] constexpr bool empty() const noexcept;
 
     // [span.elem], span element access
-    constexpr reference operator[](size_type idx) const;
+    constexpr reference operator[](size_type idx) const _LIBCPP_LIFETIMEBOUND;
     constexpr reference at(size_type idx) const; // since C++26
-    constexpr reference front() const;
-    constexpr reference back() const;
-    constexpr pointer data() const noexcept;
+    constexpr reference front() const _LIBCPP_LIFETIMEBOUND;
+    constexpr reference back() const _LIBCPP_LIFETIMEBOUND;
+    constexpr pointer data() const noexcept _LIBCPP_LIFETIMEBOUND;
 
     // [span.iterators], span iterator support
-    constexpr iterator begin() const noexcept;
-    constexpr iterator end() const noexcept;
+    constexpr iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    constexpr iterator end() const noexcept _LIBCPP_LIFETIMEBOUND;
     constexpr reverse_iterator rbegin() const noexcept;
     constexpr reverse_iterator rend() const noexcept;
 
@@ -350,7 +350,7 @@ public:
   _LIBCPP_HIDE_FROM_ABI constexpr size_type size_bytes() const noexcept { return _Extent * sizeof(element_type); }
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const noexcept { return _Extent == 0; }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](size_type __idx) const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](size_type __idx) const noexcept _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx < size(), "span<T, N>::operator[](index): index out of range");
     return __data_[__idx];
   }
@@ -363,27 +363,27 @@ public:
   }
 #  endif
 
-  _LIBCPP_HIDE_FROM_ABI constexpr reference front() const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr reference front() const noexcept _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T, N>::front() on empty span");
     return __data_[0];
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr reference back() const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr reference back() const noexcept _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T, N>::back() on empty span");
     return __data_[size() - 1];
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr pointer data() const noexcept { return __data_; }
+  _LIBCPP_HIDE_FROM_ABI constexpr pointer data() const noexcept _LIBCPP_LIFETIMEBOUND { return __data_; }
 
   // [span.iter], span iterator support
-  _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND {
 #  ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
     return std::__make_bounded_iter(data(), data(), data() + size());
 #  else
     return iterator(data());
 #  endif
   }
-  _LIBCPP_HIDE_FROM_ABI constexpr iterator end() const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr iterator end() const noexcept _LIBCPP_LIFETIMEBOUND {
 #  ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
     return std::__make_bounded_iter(data() + size(), data(), data() + size());
 #  else
@@ -512,7 +512,7 @@ public:
   _LIBCPP_HIDE_FROM_ABI constexpr size_type size_bytes() const noexcept { return __size_ * sizeof(element_type); }
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const noexcept { return __size_ == 0; }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](size_type __idx) const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr reference operator[](size_type __idx) const noexcept _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx < size(), "span<T>::operator[](index): index out of range");
     return __data_[__idx];
   }
@@ -525,27 +525,27 @@ public:
   }
 #  endif
 
-  _LIBCPP_HIDE_FROM_ABI constexpr reference front() const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr reference front() const noexcept _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T>::front() on empty span");
     return __data_[0];
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr reference back() const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr reference back() const noexcept _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "span<T>::back() on empty span");
     return __data_[size() - 1];
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr pointer data() const noexcept { return __data_; }
+  _LIBCPP_HIDE_FROM_ABI constexpr pointer data() const noexcept _LIBCPP_LIFETIMEBOUND { return __data_; }
 
   // [span.iter], span iterator support
-  _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND {
 #  ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
     return std::__make_bounded_iter(data(), data(), data() + size());
 #  else
     return iterator(data());
 #  endif
   }
-  _LIBCPP_HIDE_FROM_ABI constexpr iterator end() const noexcept {
+  _LIBCPP_HIDE_FROM_ABI constexpr iterator end() const noexcept _LIBCPP_LIFETIMEBOUND {
 #  ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
     return std::__make_bounded_iter(data() + size(), data(), data() + size());
 #  else
diff --git a/libcxx/include/stack b/libcxx/include/stack
index f75769f8a42062..237c90e1528dcb 100644
--- a/libcxx/include/stack
+++ b/libcxx/include/stack
@@ -62,7 +62,7 @@ public:
     void push(value_type&& x);
     template<container-compatible-range<T> R>
       void push_range(R&& rg); // C++23
-    template <class... Args> reference emplace(Args&&... args); // reference in C++17
+    template <class... Args> reference emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND; // reference in C++17
     void pop();
 
     void swap(stack& c) noexcept(is_nothrow_swappable_v<Container>)
diff --git a/libcxx/include/string b/libcxx/include/string
index 4b5017f5e7753f..5c620336329264 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -62,7 +62,7 @@ struct char_traits
 
     static int              compare(const char_type* s1, const char_type* s2, size_t n);
     static size_t           length(const char_type* s);
-    static const char_type* find(const char_type* s, size_t n, const char_type& a);
+    static const char_type* find(const char_type* s, size_t n, const char_type& a) _LIBCPP_LIFETIMEBOUND;
     static char_type*       move(char_type* s1, const char_type* s2, size_t n);
     static char_type*       copy(char_type* s1, const char_type* s2, size_t n);
     static char_type*       assign(char_type* s, size_t n, char_type a);
@@ -148,18 +148,18 @@ public:
     basic_string& operator=(value_type c);                                                      // constexpr since C++20
     basic_string& operator=(initializer_list<value_type>);                                      // constexpr since C++20
 
-    iterator       begin() noexcept;                                                            // constexpr since C++20
-    const_iterator begin() const noexcept;                                                      // constexpr since C++20
-    iterator       end() noexcept;                                                              // constexpr since C++20
-    const_iterator end() const noexcept;                                                        // constexpr since C++20
+    iterator       begin() noexcept _LIBCPP_LIFETIMEBOUND;                                                            // constexpr since C++20
+    const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;                                                      // constexpr since C++20
+    iterator       end() noexcept _LIBCPP_LIFETIMEBOUND;                                                              // constexpr since C++20
+    const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND;                                                        // constexpr since C++20
 
     reverse_iterator       rbegin() noexcept;                                                   // constexpr since C++20
     const_reverse_iterator rbegin() const noexcept;                                             // constexpr since C++20
     reverse_iterator       rend() noexcept;                                                     // constexpr since C++20
     const_reverse_iterator rend() const noexcept;                                               // constexpr since C++20
 
-    const_iterator         cbegin() const noexcept;                                             // constexpr since C++20
-    const_iterator         cend() const noexcept;                                               // constexpr since C++20
+    const_iterator         cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;                                             // constexpr since C++20
+    const_iterator         cend() const noexcept _LIBCPP_LIFETIMEBOUND;                                               // constexpr since C++20
     const_reverse_iterator crbegin() const noexcept;                                            // constexpr since C++20
     const_reverse_iterator crend() const noexcept;                                              // constexpr since C++20
 
@@ -180,8 +180,8 @@ public:
     void clear() noexcept;                                                                      // constexpr since C++20
     bool empty() const noexcept;                                                                // constexpr since C++20
 
-    const_reference operator[](size_type pos) const;                                            // constexpr since C++20
-    reference       operator[](size_type pos);                                                  // constexpr since C++20
+    const_reference operator[](size_type pos) const _LIBCPP_LIFETIMEBOUND;                                            // constexpr since C++20
+    reference       operator[](size_type pos) _LIBCPP_LIFETIMEBOUND;                                                  // constexpr since C++20
 
     const_reference at(size_type n) const;                                                      // constexpr since C++20
     reference       at(size_type n);                                                            // constexpr since C++20
@@ -210,10 +210,10 @@ public:
 
     void push_back(value_type c);                                                               // constexpr since C++20
     void pop_back();                                                                            // constexpr since C++20
-    reference       front();                                                                    // constexpr since C++20
-    const_reference front() const;                                                              // constexpr since C++20
-    reference       back();                                                                     // constexpr since C++20
-    const_reference back() const;                                                               // constexpr since C++20
+    reference       front() _LIBCPP_LIFETIMEBOUND;                                                                    // constexpr since C++20
+    const_reference front() const _LIBCPP_LIFETIMEBOUND;                                                              // constexpr since C++20
+    reference       back() _LIBCPP_LIFETIMEBOUND;                                                                     // constexpr since C++20
+    const_reference back() const _LIBCPP_LIFETIMEBOUND;                                                               // constexpr since C++20
 
     basic_string& assign(const basic_string& str);                                              // constexpr since C++20
     template <class T>
@@ -231,27 +231,27 @@ public:
       constexpr basic_string& assign_range(R&& rg);                                             // C++23
     basic_string& assign(initializer_list<value_type>);                                         // constexpr since C++20
 
-    basic_string& insert(size_type pos1, const basic_string& str);                              // constexpr since C++20
+    basic_string& insert(size_type pos1, const basic_string& str) _LIBCPP_LIFETIMEBOUND;                              // constexpr since C++20
     template <class T>
-        basic_string& insert(size_type pos1, const T& t);                                       // constexpr since C++20
+        basic_string& insert(size_type pos1, const T& t) _LIBCPP_LIFETIMEBOUND;                                       // constexpr since C++20
     basic_string& insert(size_type pos1, const basic_string& str,
-                         size_type pos2, size_type n);                                          // constexpr since C++20
+                         size_type pos2, size_type n) _LIBCPP_LIFETIMEBOUND;                                          // constexpr since C++20
     template <class T>
-        basic_string& insert(size_type pos1, const T& t, size_type pos2, size_type n);          // C++17, constexpr since C++20
-    basic_string& insert(size_type pos, const value_type* s, size_type n=npos);                 // C++14, constexpr since C++20
-    basic_string& insert(size_type pos, const value_type* s);                                   // constexpr since C++20
-    basic_string& insert(size_type pos, size_type n, value_type c);                             // constexpr since C++20
-    iterator      insert(const_iterator p, value_type c);                                       // constexpr since C++20
-    iterator      insert(const_iterator p, size_type n, value_type c);                          // constexpr since C++20
+        basic_string& insert(size_type pos1, const T& t, size_type pos2, size_type n) _LIBCPP_LIFETIMEBOUND;          // C++17, constexpr since C++20
+    basic_string& insert(size_type pos, const value_type* s, size_type n=npos) _LIBCPP_LIFETIMEBOUND;                 // C++14, constexpr since C++20
+    basic_string& insert(size_type pos, const value_type* s) _LIBCPP_LIFETIMEBOUND;                                   // constexpr since C++20
+    basic_string& insert(size_type pos, size_type n, value_type c) _LIBCPP_LIFETIMEBOUND;                             // constexpr since C++20
+    iterator      insert(const_iterator p, value_type c) _LIBCPP_LIFETIMEBOUND;                                       // constexpr since C++20
+    iterator      insert(const_iterator p, size_type n, value_type c) _LIBCPP_LIFETIMEBOUND;                          // constexpr since C++20
     template<class InputIterator>
-        iterator insert(const_iterator p, InputIterator first, InputIterator last);             // constexpr since C++20
+        iterator insert(const_iterator p, InputIterator first, InputIterator last) _LIBCPP_LIFETIMEBOUND;             // constexpr since C++20
     template<container-compatible-range<charT> R>
-      constexpr iterator insert_range(const_iterator p, R&& rg);                                // C++23
-    iterator      insert(const_iterator p, initializer_list<value_type>);                       // constexpr since C++20
+      constexpr iterator insert_range(const_iterator p, R&& rg) _LIBCPP_LIFETIMEBOUND;                                // C++23
+    iterator      insert(const_iterator p, initializer_list<value_type>) _LIBCPP_LIFETIMEBOUND;                       // constexpr since C++20
 
-    basic_string& erase(size_type pos = 0, size_type n = npos);                                 // constexpr since C++20
-    iterator      erase(const_iterator position);                                               // constexpr since C++20
-    iterator      erase(const_iterator first, const_iterator last);                             // constexpr since C++20
+    basic_string& erase(size_type pos = 0, size_type n = npos) _LIBCPP_LIFETIMEBOUND;                                 // constexpr since C++20
+    iterator      erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;                                               // constexpr since C++20
+    iterator      erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;                             // constexpr since C++20
 
     basic_string& replace(size_type pos1, size_type n1, const basic_string& str);               // constexpr since C++20
     template <class T>
@@ -1216,7 +1216,7 @@ public:
       __alloc_traits::deallocate(__alloc_, __get_long_pointer(), __get_long_cap());
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return __self_view(typename __self_view::__assume_valid(), data(), size());
   }
 
@@ -1251,16 +1251,16 @@ public:
 #endif
   _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(value_type __c);
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return __make_iterator(__get_pointer());
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return __make_const_iterator(__get_pointer());
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return __make_iterator(__get_pointer() + size());
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return __make_const_iterator(__get_pointer() + size());
   }
 
@@ -1277,8 +1277,8 @@ public:
     return const_reverse_iterator(begin());
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT { return begin(); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cend() const _NOEXCEPT { return end(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crbegin() const _NOEXCEPT {
     return rbegin();
   }
@@ -1328,7 +1328,7 @@ public:
     return size() == 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __pos) const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __pos) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos <= size(), "string index out of bounds");
     if (__builtin_constant_p(__pos) && !__fits_in_sso(__pos)) {
       return *(__get_long_pointer() + __pos);
@@ -1336,7 +1336,7 @@ public:
     return *(data() + __pos);
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __pos) _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __pos) _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos <= size(), "string index out of bounds");
     if (__builtin_constant_p(__pos) && !__fits_in_sso(__pos)) {
       return *(__get_long_pointer() + __pos);
@@ -1436,22 +1436,22 @@ public:
   _LIBCPP_CONSTEXPR_SINCE_CXX20 void push_back(value_type __c);
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back();
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::front(): string is empty");
     return *__get_pointer();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::front(): string is empty");
     return *data();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::back(): string is empty");
     return *(__get_pointer() + size() - 1);
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string::back(): string is empty");
     return *(data() + size() - 1);
   }
@@ -1539,13 +1539,13 @@ public:
 #endif // _LIBCPP_CXX03_LANG
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
-  insert(size_type __pos1, const basic_string& __str) {
+  insert(size_type __pos1, const basic_string& __str) _LIBCPP_LIFETIMEBOUND {
     return insert(__pos1, __str.data(), __str.size());
   }
 
   template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
   _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
-  insert(size_type __pos1, const _Tp& __t) {
+  insert(size_type __pos1, const _Tp& __t) _LIBCPP_LIFETIMEBOUND {
     __self_view __sv = __t;
     return insert(__pos1, __sv.data(), __sv.size());
   }
@@ -1555,18 +1555,18 @@ public:
                               !__is_same_uncvref<_Tp, basic_string>::value,
                           int> = 0>
   _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
-  insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n = npos);
+  insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n = npos) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
-  insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos);
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s);
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c);
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c);
+  insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c) _LIBCPP_LIFETIMEBOUND;
 
 #if _LIBCPP_STD_VER >= 23
   template <_ContainerCompatibleRange<_CharT> _Range>
-  _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
+  _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
     if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
       auto __n = static_cast<size_type>(ranges::distance(__range));
       return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
@@ -1579,7 +1579,7 @@ public:
 #endif
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
-  insert(const_iterator __pos, size_type __n, value_type __c) {
+  insert(const_iterator __pos, size_type __n, value_type __c) _LIBCPP_LIFETIMEBOUND {
     difference_type __p = __pos - begin();
     insert(static_cast<size_type>(__p), __n, __c);
     return begin() + __p;
@@ -1587,22 +1587,22 @@ public:
 
   template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
   _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
-  insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);
+  insert(const_iterator __pos, _InputIterator __first, _InputIterator __last) _LIBCPP_LIFETIMEBOUND;
 
   template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
   _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
-  insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
+  insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last) _LIBCPP_LIFETIMEBOUND;
 
 #ifndef _LIBCPP_CXX03_LANG
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
-  insert(const_iterator __pos, initializer_list<value_type> __il) {
+  insert(const_iterator __pos, initializer_list<value_type> __il) _LIBCPP_LIFETIMEBOUND {
     return insert(__pos, __il.begin(), __il.end());
   }
 #endif // _LIBCPP_CXX03_LANG
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& erase(size_type __pos = 0, size_type __n = npos);
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __pos);
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __first, const_iterator __last);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& erase(size_type __pos = 0, size_type __n = npos) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __pos) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
   replace(size_type __pos1, size_type __n1, const basic_string& __str) {
diff --git a/libcxx/include/string_view b/libcxx/include/string_view
index 5beac404fb5b54..2395a46b3c956c 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -100,10 +100,10 @@ namespace std {
       constexpr basic_string_view(Range&& r); // C++23
 
       // 7.4, basic_string_view iterator support
-      constexpr const_iterator begin() const noexcept;
-      constexpr const_iterator end() const noexcept;
-      constexpr const_iterator cbegin() const noexcept;
-      constexpr const_iterator cend() const noexcept;
+      constexpr const_iterator begin() const noexcept _LIBCPP_LIFETIMEBOUND;
+      constexpr const_iterator end() const noexcept _LIBCPP_LIFETIMEBOUND;
+      constexpr const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;
+      constexpr const_iterator cend() const noexcept _LIBCPP_LIFETIMEBOUND;
       const_reverse_iterator rbegin() const noexcept;
       const_reverse_iterator rend() const noexcept;
       const_reverse_iterator crbegin() const noexcept;
@@ -116,11 +116,11 @@ namespace std {
       constexpr bool empty() const noexcept;
 
       // 7.6, basic_string_view element access
-      constexpr const_reference operator[](size_type pos) const;
+      constexpr const_reference operator[](size_type pos) const _LIBCPP_LIFETIMEBOUND;
       constexpr const_reference at(size_type pos) const;
-      constexpr const_reference front() const;
-      constexpr const_reference back() const;
-      constexpr const_pointer data() const noexcept;
+      constexpr const_reference front() const _LIBCPP_LIFETIMEBOUND;
+      constexpr const_reference back() const _LIBCPP_LIFETIMEBOUND;
+      constexpr const_pointer data() const noexcept _LIBCPP_LIFETIMEBOUND;
 
       // 7.7, basic_string_view modifiers
       constexpr void remove_prefix(size_type n);
@@ -351,11 +351,11 @@ public:
 #endif
 
   // [string.view.iterators], iterators
-  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return cbegin(); }
+  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return cbegin(); }
 
-  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return cend(); }
+  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return cend(); }
 
-  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {
+  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
 #ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
     return std::__make_bounded_iter(data(), data(), data() + size());
 #else
@@ -363,7 +363,7 @@ public:
 #endif
   }
 
-  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT {
+  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
 #ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
     return std::__make_bounded_iter(data() + size(), data(), data() + size());
 #else
@@ -399,7 +399,7 @@ public:
   [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT { return __size_ == 0; }
 
   // [string.view.access], element access
-  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __pos) const _NOEXCEPT {
+  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __pos) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos < size(), "string_view[] index out of bounds"), __data_[__pos];
   }
 
@@ -407,15 +407,15 @@ public:
     return __pos >= size() ? (__throw_out_of_range("string_view::at"), __data_[0]) : __data_[__pos];
   }
 
-  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {
+  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string_view::front(): string is empty"), __data_[0];
   }
 
-  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
+  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "string_view::back(): string is empty"), __data_[__size_ - 1];
   }
 
-  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_pointer data() const _NOEXCEPT { return __data_; }
+  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI const_pointer data() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __data_; }
 
   // [string.view.modifiers], modifiers:
   _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI void remove_prefix(size_type __n) _NOEXCEPT {
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index 05aa01a3b7c308..e3da9906e32f10 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -114,23 +114,23 @@ public:
     size_type size() const noexcept;
     size_type max_size() const noexcept;
 
-    iterator       begin() noexcept;
-    iterator       end() noexcept;
-    const_iterator begin()  const noexcept;
-    const_iterator end()    const noexcept;
-    const_iterator cbegin() const noexcept;
-    const_iterator cend()   const noexcept;
+    iterator       begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    iterator       end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()    const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cend()   const noexcept _LIBCPP_LIFETIMEBOUND;
 
     template <class... Args>
-        pair<iterator, bool> emplace(Args&&... args);
+        pair<iterator, bool> emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND;
     template <class... Args>
-        iterator emplace_hint(const_iterator position, Args&&... args);
-    pair<iterator, bool> insert(const value_type& obj);
+        iterator emplace_hint(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    pair<iterator, bool> insert(const value_type& obj) _LIBCPP_LIFETIMEBOUND;
     template <class P>
-        pair<iterator, bool> insert(P&& obj);
-    iterator insert(const_iterator hint, const value_type& obj);
+        pair<iterator, bool> insert(P&& obj) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator hint, const value_type& obj) _LIBCPP_LIFETIMEBOUND;
     template <class P>
-        iterator insert(const_iterator hint, P&& obj);
+        iterator insert(const_iterator hint, P&& obj) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
     template<container-compatible-range<value_type> R>
@@ -140,7 +140,7 @@ public:
     node_type extract(const_iterator position);                                       // C++17
     node_type extract(const key_type& x);                                             // C++17
     insert_return_type insert(node_type&& nh);                                        // C++17
-    iterator           insert(const_iterator hint, node_type&& nh);                   // C++17
+    iterator           insert(const_iterator hint, node_type&& nh) _LIBCPP_LIFETIMEBOUND;                   // C++17
 
     template <class... Args>
         pair<iterator, bool> try_emplace(const key_type& k, Args&&... args);          // C++17
@@ -151,18 +151,18 @@ public:
     template <class... Args>
         iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args);      // C++17
     template <class M>
-        pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj);            // C++17
+        pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj) _LIBCPP_LIFETIMEBOUND;            // C++17
     template <class M>
-        pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj);                 // C++17
+        pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj) _LIBCPP_LIFETIMEBOUND;                 // C++17
     template <class M>
-        iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj);   // C++17
+        iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj) _LIBCPP_LIFETIMEBOUND;   // C++17
     template <class M>
-        iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj);        // C++17
+        iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj) _LIBCPP_LIFETIMEBOUND;        // C++17
 
-    iterator erase(const_iterator position);
-    iterator erase(iterator position);  // C++14
+    iterator erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator erase(iterator position) _LIBCPP_LIFETIMEBOUND;  // C++14
     size_type erase(const key_type& k);
-    iterator erase(const_iterator first, const_iterator last);
+    iterator erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
     void clear() noexcept;
 
     template<class H2, class P2>
@@ -184,27 +184,27 @@ public:
     hasher hash_function() const;
     key_equal key_eq() const;
 
-    iterator       find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+    iterator       find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator find(const K& x);              // C++20
+        iterator find(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++20
     template<typename K>
-        const_iterator find(const K& x) const;  // C++20
+        const_iterator find(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++20
     size_type count(const key_type& k) const;
     template<typename K>
         size_type count(const K& k) const; // C++20
     bool contains(const key_type& k) const; // C++20
     template<typename K>
         bool contains(const K& k) const; // C++20
-    pair<iterator, iterator>             equal_range(const key_type& k);
-    pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+    pair<iterator, iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator, const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        pair<iterator, iterator>             equal_range(const K& k); // C++20
+        pair<iterator, iterator>             equal_range(const K& k) _LIBCPP_LIFETIMEBOUND; // C++20
     template<typename K>
-        pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
+        pair<const_iterator, const_iterator> equal_range(const K& k) const _LIBCPP_LIFETIMEBOUND; // C++20
 
-    mapped_type& operator[](const key_type& k);
-    mapped_type& operator[](key_type&& k);
+    mapped_type& operator[](const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    mapped_type& operator[](key_type&& k) _LIBCPP_LIFETIMEBOUND;
 
     mapped_type&       at(const key_type& k);
     const mapped_type& at(const key_type& k) const;
@@ -215,12 +215,12 @@ public:
     size_type bucket_size(size_type n) const;
     size_type bucket(const key_type& k) const;
 
-    local_iterator       begin(size_type n);
-    local_iterator       end(size_type n);
-    const_local_iterator begin(size_type n) const;
-    const_local_iterator end(size_type n) const;
-    const_local_iterator cbegin(size_type n) const;
-    const_local_iterator cend(size_type n) const;
+    local_iterator       begin(size_type n) _LIBCPP_LIFETIMEBOUND;
+    local_iterator       end(size_type n) _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator begin(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator end(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator cbegin(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator cend(size_type n) const _LIBCPP_LIFETIMEBOUND;
 
     float load_factor() const noexcept;
     float max_load_factor() const noexcept;
@@ -400,23 +400,23 @@ public:
     size_type size() const noexcept;
     size_type max_size() const noexcept;
 
-    iterator       begin() noexcept;
-    iterator       end() noexcept;
-    const_iterator begin()  const noexcept;
-    const_iterator end()    const noexcept;
-    const_iterator cbegin() const noexcept;
-    const_iterator cend()   const noexcept;
+    iterator       begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    iterator       end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()    const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cend()   const noexcept _LIBCPP_LIFETIMEBOUND;
 
     template <class... Args>
-        iterator emplace(Args&&... args);
+        iterator emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND;
     template <class... Args>
-        iterator emplace_hint(const_iterator position, Args&&... args);
-    iterator insert(const value_type& obj);
+        iterator emplace_hint(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const value_type& obj) _LIBCPP_LIFETIMEBOUND;
     template <class P>
-        iterator insert(P&& obj);
-    iterator insert(const_iterator hint, const value_type& obj);
+        iterator insert(P&& obj) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator hint, const value_type& obj) _LIBCPP_LIFETIMEBOUND;
     template <class P>
-        iterator insert(const_iterator hint, P&& obj);
+        iterator insert(const_iterator hint, P&& obj) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
     template<container-compatible-range<value_type> R>
@@ -425,13 +425,13 @@ public:
 
     node_type extract(const_iterator position);                // C++17
     node_type extract(const key_type& x);                      // C++17
-    iterator insert(node_type&& nh);                           // C++17
-    iterator insert(const_iterator hint, node_type&& nh);      // C++17
+    iterator insert(node_type&& nh) _LIBCPP_LIFETIMEBOUND;                           // C++17
+    iterator insert(const_iterator hint, node_type&& nh) _LIBCPP_LIFETIMEBOUND;      // C++17
 
-    iterator erase(const_iterator position);
-    iterator erase(iterator position);  // C++14
+    iterator erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator erase(iterator position) _LIBCPP_LIFETIMEBOUND;  // C++14
     size_type erase(const key_type& k);
-    iterator erase(const_iterator first, const_iterator last);
+    iterator erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
     void clear() noexcept;
 
     template<class H2, class P2>
@@ -453,24 +453,24 @@ public:
     hasher hash_function() const;
     key_equal key_eq() const;
 
-    iterator       find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+    iterator       find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator find(const K& x);              // C++20
+        iterator find(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++20
     template<typename K>
-        const_iterator find(const K& x) const;  // C++20
+        const_iterator find(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++20
     size_type count(const key_type& k) const;
     template<typename K>
         size_type count(const K& k) const; // C++20
     bool contains(const key_type& k) const; // C++20
     template<typename K>
         bool contains(const K& k) const; // C++20
-    pair<iterator, iterator>             equal_range(const key_type& k);
-    pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+    pair<iterator, iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator, const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        pair<iterator, iterator>             equal_range(const K& k); // C++20
+        pair<iterator, iterator>             equal_range(const K& k) _LIBCPP_LIFETIMEBOUND; // C++20
     template<typename K>
-        pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
+        pair<const_iterator, const_iterator> equal_range(const K& k) const _LIBCPP_LIFETIMEBOUND; // C++20
 
     size_type bucket_count() const noexcept;
     size_type max_bucket_count() const noexcept;
@@ -478,12 +478,12 @@ public:
     size_type bucket_size(size_type n) const;
     size_type bucket(const key_type& k) const;
 
-    local_iterator       begin(size_type n);
-    local_iterator       end(size_type n);
-    const_local_iterator begin(size_type n) const;
-    const_local_iterator end(size_type n) const;
-    const_local_iterator cbegin(size_type n) const;
-    const_local_iterator cend(size_type n) const;
+    local_iterator       begin(size_type n) _LIBCPP_LIFETIMEBOUND;
+    local_iterator       end(size_type n) _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator begin(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator end(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator cbegin(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator cend(size_type n) const _LIBCPP_LIFETIMEBOUND;
 
     float load_factor() const noexcept;
     float max_load_factor() const noexcept;
@@ -1217,16 +1217,16 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __x) { return __table_.__insert_unique(__x); }
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_unique(__x); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x).first; }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x).first; }
 
   template <class _InputIterator>
   _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
@@ -1243,31 +1243,31 @@ public:
 #ifndef _LIBCPP_CXX03_LANG
   _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __x) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_unique(std::move(__x));
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, value_type&& __x) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, value_type&& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_unique(std::move(__x)).first;
   }
 
   template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(_Pp&& __x) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(_Pp&& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_unique(std::forward<_Pp>(__x));
   }
 
   template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, _Pp&& __x) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, _Pp&& __x) _LIBCPP_LIFETIMEBOUND {
     return insert(std::forward<_Pp>(__x)).first;
   }
 
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __table_.__emplace_unique(std::forward<_Args>(__args)...);
   }
 
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __table_.__emplace_unique(std::forward<_Args>(__args)...).first;
   }
 
@@ -1300,7 +1300,7 @@ public:
   }
 
   template <class _Vp>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND {
     pair<iterator, bool> __res = __table_.__emplace_unique_key_args(__k, __k, std::forward<_Vp>(__v));
     if (!__res.second) {
       __res.first->second = std::forward<_Vp>(__v);
@@ -1309,7 +1309,7 @@ public:
   }
 
   template <class _Vp>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND {
     pair<iterator, bool> __res = __table_.__emplace_unique_key_args(__k, std::move(__k), std::forward<_Vp>(__v));
     if (!__res.second) {
       __res.first->second = std::forward<_Vp>(__v);
@@ -1318,20 +1318,20 @@ public:
   }
 
   template <class _Vp>
-  _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator, const key_type& __k, _Vp&& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator, const key_type& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND {
     return insert_or_assign(__k, std::forward<_Vp>(__v)).first;
   }
 
   template <class _Vp>
-  _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator, key_type&& __k, _Vp&& __v) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator, key_type&& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND {
     return insert_or_assign(std::move(__k), std::forward<_Vp>(__v)).first;
   }
 #endif // _LIBCPP_STD_VER >= 17
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __table_.erase(__p.__i_); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __table_.erase(__p.__i_); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __table_.erase(__p.__i_); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) _LIBCPP_LIFETIMEBOUND { return __table_.erase(__p.__i_); }
   _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __table_.__erase_unique(__k); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) {
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND {
     return __table_.erase(__first.__i_, __last.__i_);
   }
   _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __table_.clear(); }
@@ -1342,7 +1342,7 @@ public:
                                         "node_type with incompatible allocator passed to unordered_map::insert()");
     return __table_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to unordered_map::insert()");
     return __table_.template __node_handle_insert_unique<node_type>(__hint.__i_, std::move(__nh));
@@ -1387,15 +1387,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function().hash_function(); }
   _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq().key_eq(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
 #if _LIBCPP_STD_VER >= 20
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.find(__k);
   }
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.find(__k);
   }
 #endif // _LIBCPP_STD_VER >= 20
@@ -1417,26 +1417,26 @@ public:
   }
 #endif // _LIBCPP_STD_VER >= 20
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
 #if _LIBCPP_STD_VER >= 20
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
 #endif // _LIBCPP_STD_VER >= 20
 
-  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);
+  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k) _LIBCPP_LIFETIMEBOUND;
 #ifndef _LIBCPP_CXX03_LANG
-  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);
+  _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k) _LIBCPP_LIFETIMEBOUND;
 #endif
 
   _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k);
@@ -1448,12 +1448,12 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const { return __table_.bucket_size(__n); }
   _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }
 
-  _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }
-  _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const { return __table_.cbegin(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const { return __table_.cbegin(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }
+  _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) _LIBCPP_LIFETIMEBOUND { return __table_.begin(__n); }
+  _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) _LIBCPP_LIFETIMEBOUND { return __table_.end(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cbegin(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cend(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cbegin(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cend(__n); }
 
   _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }
   _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }
@@ -2026,16 +2026,16 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__insert_multi(__x); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_multi(__x); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_multi(__p.__i_, __x);
   }
 
@@ -2053,48 +2053,48 @@ public:
 
 #ifndef _LIBCPP_CXX03_LANG
   _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return __table_.__insert_multi(std::move(__x)); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_multi(std::move(__x)); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_multi(__p.__i_, std::move(__x));
   }
 
   template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(_Pp&& __x) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(_Pp&& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_multi(std::forward<_Pp>(__x));
   }
 
   template <class _Pp, __enable_if_t<is_constructible<value_type, _Pp>::value, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _Pp&& __x) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _Pp&& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_multi(__p.__i_, std::forward<_Pp>(__x));
   }
 
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __table_.__emplace_multi(std::forward<_Args>(__args)...);
   }
 
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __table_.__emplace_hint_multi(__p.__i_, std::forward<_Args>(__args)...);
   }
 #endif // _LIBCPP_CXX03_LANG
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __table_.erase(__p.__i_); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) { return __table_.erase(__p.__i_); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __table_.erase(__p.__i_); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __p) _LIBCPP_LIFETIMEBOUND { return __table_.erase(__p.__i_); }
   _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __table_.__erase_multi(__k); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) {
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND {
     return __table_.erase(__first.__i_, __last.__i_);
   }
   _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __table_.clear(); }
 
 #if _LIBCPP_STD_VER >= 17
-  _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to unordered_multimap::insert()");
     return __table_.template __node_handle_insert_multi<node_type>(std::move(__nh));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to unordered_multimap::insert()");
     return __table_.template __node_handle_insert_multi<node_type>(__hint.__i_, std::move(__nh));
@@ -2139,15 +2139,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function().hash_function(); }
   _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq().key_eq(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
 #if _LIBCPP_STD_VER >= 20
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.find(__k);
   }
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.find(__k);
   }
 #endif // _LIBCPP_STD_VER >= 20
@@ -2169,19 +2169,19 @@ public:
   }
 #endif // _LIBCPP_STD_VER >= 20
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
 #if _LIBCPP_STD_VER >= 20
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
 #endif // _LIBCPP_STD_VER >= 20
@@ -2192,12 +2192,12 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const { return __table_.bucket_size(__n); }
   _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }
 
-  _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }
-  _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const { return __table_.cbegin(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const { return __table_.cbegin(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }
+  _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) _LIBCPP_LIFETIMEBOUND { return __table_.begin(__n); }
+  _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) _LIBCPP_LIFETIMEBOUND { return __table_.end(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cbegin(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cend(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cbegin(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cend(__n); }
 
   _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }
   _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }
diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set
index 7ab1c651b8c956..6caebf0c76db8b 100644
--- a/libcxx/include/unordered_set
+++ b/libcxx/include/unordered_set
@@ -108,21 +108,21 @@ public:
     size_type size() const noexcept;
     size_type max_size() const noexcept;
 
-    iterator       begin() noexcept;
-    iterator       end() noexcept;
-    const_iterator begin()  const noexcept;
-    const_iterator end()    const noexcept;
-    const_iterator cbegin() const noexcept;
-    const_iterator cend()   const noexcept;
+    iterator       begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    iterator       end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()    const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cend()   const noexcept _LIBCPP_LIFETIMEBOUND;
 
     template <class... Args>
-        pair<iterator, bool> emplace(Args&&... args);
+        pair<iterator, bool> emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND;
     template <class... Args>
-        iterator emplace_hint(const_iterator position, Args&&... args);
-    pair<iterator, bool> insert(const value_type& obj);
-    pair<iterator, bool> insert(value_type&& obj);
-    iterator insert(const_iterator hint, const value_type& obj);
-    iterator insert(const_iterator hint, value_type&& obj);
+        iterator emplace_hint(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    pair<iterator, bool> insert(const value_type& obj) _LIBCPP_LIFETIMEBOUND;
+    pair<iterator, bool> insert(value_type&& obj) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator hint, const value_type& obj) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator hint, value_type&& obj) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
     template<container-compatible-range<value_type> R>
@@ -132,12 +132,12 @@ public:
     node_type extract(const_iterator position);                       // C++17
     node_type extract(const key_type& x);                             // C++17
     insert_return_type insert(node_type&& nh);                        // C++17
-    iterator           insert(const_iterator hint, node_type&& nh);   // C++17
+    iterator           insert(const_iterator hint, node_type&& nh) _LIBCPP_LIFETIMEBOUND;   // C++17
 
-    iterator erase(const_iterator position);
-    iterator erase(iterator position);  // C++14
+    iterator erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator erase(iterator position) _LIBCPP_LIFETIMEBOUND;  // C++14
     size_type erase(const key_type& k);
-    iterator erase(const_iterator first, const_iterator last);
+    iterator erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
     void clear() noexcept;
 
     template<class H2, class P2>
@@ -157,24 +157,24 @@ public:
     hasher hash_function() const;
     key_equal key_eq() const;
 
-    iterator       find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+    iterator       find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator find(const K& x);              // C++20
+        iterator find(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++20
     template<typename K>
-        const_iterator find(const K& x) const;  // C++20
+        const_iterator find(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++20
     size_type count(const key_type& k) const;
     template<typename K>
         size_type count(const K& k) const; // C++20
     bool contains(const key_type& k) const; // C++20
     template<typename K>
         bool contains(const K& k) const; // C++20
-    pair<iterator, iterator>             equal_range(const key_type& k);
-    pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+    pair<iterator, iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator, const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        pair<iterator, iterator>             equal_range(const K& k); // C++20
+        pair<iterator, iterator>             equal_range(const K& k) _LIBCPP_LIFETIMEBOUND; // C++20
     template<typename K>
-        pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
+        pair<const_iterator, const_iterator> equal_range(const K& k) const _LIBCPP_LIFETIMEBOUND; // C++20
 
     size_type bucket_count() const noexcept;
     size_type max_bucket_count() const noexcept;
@@ -182,12 +182,12 @@ public:
     size_type bucket_size(size_type n) const;
     size_type bucket(const key_type& k) const;
 
-    local_iterator       begin(size_type n);
-    local_iterator       end(size_type n);
-    const_local_iterator begin(size_type n) const;
-    const_local_iterator end(size_type n) const;
-    const_local_iterator cbegin(size_type n) const;
-    const_local_iterator cend(size_type n) const;
+    local_iterator       begin(size_type n) _LIBCPP_LIFETIMEBOUND;
+    local_iterator       end(size_type n) _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator begin(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator end(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator cbegin(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator cend(size_type n) const _LIBCPP_LIFETIMEBOUND;
 
     float load_factor() const noexcept;
     float max_load_factor() const noexcept;
@@ -356,21 +356,21 @@ public:
     size_type size() const noexcept;
     size_type max_size() const noexcept;
 
-    iterator       begin() noexcept;
-    iterator       end() noexcept;
-    const_iterator begin()  const noexcept;
-    const_iterator end()    const noexcept;
-    const_iterator cbegin() const noexcept;
-    const_iterator cend()   const noexcept;
+    iterator       begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    iterator       end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator begin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator end()    const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cbegin() const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator cend()   const noexcept _LIBCPP_LIFETIMEBOUND;
 
     template <class... Args>
-        iterator emplace(Args&&... args);
+        iterator emplace(Args&&... args) _LIBCPP_LIFETIMEBOUND;
     template <class... Args>
-        iterator emplace_hint(const_iterator position, Args&&... args);
-    iterator insert(const value_type& obj);
-    iterator insert(value_type&& obj);
-    iterator insert(const_iterator hint, const value_type& obj);
-    iterator insert(const_iterator hint, value_type&& obj);
+        iterator emplace_hint(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const value_type& obj) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(value_type&& obj) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator hint, const value_type& obj) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator hint, value_type&& obj) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
         void insert(InputIterator first, InputIterator last);
     template<container-compatible-range<value_type> R>
@@ -379,13 +379,13 @@ public:
 
     node_type extract(const_iterator position);             // C++17
     node_type extract(const key_type& x);                   // C++17
-    iterator insert(node_type&& nh);                        // C++17
-    iterator insert(const_iterator hint, node_type&& nh);   // C++17
+    iterator insert(node_type&& nh) _LIBCPP_LIFETIMEBOUND;                        // C++17
+    iterator insert(const_iterator hint, node_type&& nh) _LIBCPP_LIFETIMEBOUND;   // C++17
 
-    iterator erase(const_iterator position);
-    iterator erase(iterator position);  // C++14
+    iterator erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator erase(iterator position) _LIBCPP_LIFETIMEBOUND;  // C++14
     size_type erase(const key_type& k);
-    iterator erase(const_iterator first, const_iterator last);
+    iterator erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
     void clear() noexcept;
 
     template<class H2, class P2>
@@ -405,24 +405,24 @@ public:
     hasher hash_function() const;
     key_equal key_eq() const;
 
-    iterator       find(const key_type& k);
-    const_iterator find(const key_type& k) const;
+    iterator       find(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    const_iterator find(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        iterator find(const K& x);              // C++20
+        iterator find(const K& x) _LIBCPP_LIFETIMEBOUND;              // C++20
     template<typename K>
-        const_iterator find(const K& x) const;  // C++20
+        const_iterator find(const K& x) const _LIBCPP_LIFETIMEBOUND;  // C++20
     size_type count(const key_type& k) const;
     template<typename K>
         size_type count(const K& k) const; // C++20
     bool contains(const key_type& k) const; // C++20
     template<typename K>
         bool contains(const K& k) const; // C++20
-    pair<iterator, iterator>             equal_range(const key_type& k);
-    pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+    pair<iterator, iterator>             equal_range(const key_type& k) _LIBCPP_LIFETIMEBOUND;
+    pair<const_iterator, const_iterator> equal_range(const key_type& k) const _LIBCPP_LIFETIMEBOUND;
     template<typename K>
-        pair<iterator, iterator>             equal_range(const K& k); // C++20
+        pair<iterator, iterator>             equal_range(const K& k) _LIBCPP_LIFETIMEBOUND; // C++20
     template<typename K>
-        pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
+        pair<const_iterator, const_iterator> equal_range(const K& k) const _LIBCPP_LIFETIMEBOUND; // C++20
 
     size_type bucket_count() const noexcept;
     size_type max_bucket_count() const noexcept;
@@ -430,12 +430,12 @@ public:
     size_type bucket_size(size_type n) const;
     size_type bucket(const key_type& k) const;
 
-    local_iterator       begin(size_type n);
-    local_iterator       end(size_type n);
-    const_local_iterator begin(size_type n) const;
-    const_local_iterator end(size_type n) const;
-    const_local_iterator cbegin(size_type n) const;
-    const_local_iterator cend(size_type n) const;
+    local_iterator       begin(size_type n) _LIBCPP_LIFETIMEBOUND;
+    local_iterator       end(size_type n) _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator begin(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator end(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator cbegin(size_type n) const _LIBCPP_LIFETIMEBOUND;
+    const_local_iterator cend(size_type n) const _LIBCPP_LIFETIMEBOUND;
 
     float load_factor() const noexcept;
     float max_load_factor() const noexcept;
@@ -748,33 +748,33 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
 
 #ifndef _LIBCPP_CXX03_LANG
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __table_.__emplace_unique(std::forward<_Args>(__args)...);
   }
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __table_.__emplace_unique(std::forward<_Args>(__args)...).first;
   }
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __x) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_unique(std::move(__x));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, value_type&& __x) { return insert(std::move(__x)).first; }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, value_type&& __x) _LIBCPP_LIFETIMEBOUND { return insert(std::move(__x)).first; }
 
   _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
 #endif // _LIBCPP_CXX03_LANG
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __x) { return __table_.__insert_unique(__x); }
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_unique(__x); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x).first; }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x).first; }
   template <class _InputIterator>
   _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last);
 
@@ -787,9 +787,9 @@ public:
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __table_.erase(__p); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __table_.erase(__p); }
   _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __table_.__erase_unique(__k); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) {
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND {
     return __table_.erase(__first, __last);
   }
   _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __table_.clear(); }
@@ -800,7 +800,7 @@ public:
                                         "node_type with incompatible allocator passed to unordered_set::insert()");
     return __table_.template __node_handle_insert_unique< node_type, insert_return_type>(std::move(__nh));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __h, node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __h, node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to unordered_set::insert()");
     return __table_.template __node_handle_insert_unique<node_type>(__h, std::move(__nh));
@@ -845,15 +845,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function(); }
   _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
 #if _LIBCPP_STD_VER >= 20
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.find(__k);
   }
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.find(__k);
   }
 #endif // _LIBCPP_STD_VER >= 20
@@ -875,19 +875,19 @@ public:
   }
 #endif // _LIBCPP_STD_VER >= 20
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
 #if _LIBCPP_STD_VER >= 20
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_unique(__k);
   }
 #endif // _LIBCPP_STD_VER >= 20
@@ -898,12 +898,12 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const { return __table_.bucket_size(__n); }
   _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }
 
-  _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }
-  _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const { return __table_.cbegin(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const { return __table_.cbegin(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }
+  _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) _LIBCPP_LIFETIMEBOUND { return __table_.begin(__n); }
+  _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) _LIBCPP_LIFETIMEBOUND { return __table_.end(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cbegin(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cend(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cbegin(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cend(__n); }
 
   _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }
   _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }
@@ -1352,33 +1352,33 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __table_.size(); }
   _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __table_.max_size(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __table_.end(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.begin(); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __table_.end(); }
 
 #ifndef _LIBCPP_CXX03_LANG
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __table_.__emplace_multi(std::forward<_Args>(__args)...);
   }
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __table_.__emplace_hint_multi(__p, std::forward<_Args>(__args)...);
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return __table_.__insert_multi(std::move(__x)); }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_multi(std::move(__x)); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_multi(__p, std::move(__x));
   }
   _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
 #endif // _LIBCPP_CXX03_LANG
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__insert_multi(__x); }
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_multi(__x); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x) _LIBCPP_LIFETIMEBOUND {
     return __table_.__insert_multi(__p, __x);
   }
 
@@ -1395,12 +1395,12 @@ public:
 #endif
 
 #if _LIBCPP_STD_VER >= 17
-  _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to unordered_multiset::insert()");
     return __table_.template __node_handle_insert_multi<node_type>(std::move(__nh));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) {
+  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, node_type&& __nh) _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(__nh.empty() || __nh.get_allocator() == get_allocator(),
                                         "node_type with incompatible allocator passed to unordered_multiset::insert()");
     return __table_.template __node_handle_insert_multi<node_type>(__hint, std::move(__nh));
@@ -1438,9 +1438,9 @@ public:
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) { return __table_.erase(__p); }
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p) _LIBCPP_LIFETIMEBOUND { return __table_.erase(__p); }
   _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __k) { return __table_.__erase_multi(__k); }
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) {
+  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND {
     return __table_.erase(__first, __last);
   }
   _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __table_.clear(); }
@@ -1452,15 +1452,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI hasher hash_function() const { return __table_.hash_function(); }
   _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); }
 
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __table_.find(__k); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.find(__k); }
 #if _LIBCPP_STD_VER >= 20
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.find(__k);
   }
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.find(__k);
   }
 #endif // _LIBCPP_STD_VER >= 20
@@ -1482,19 +1482,19 @@ public:
   }
 #endif // _LIBCPP_STD_VER >= 20
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
 #if _LIBCPP_STD_VER >= 20
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
+  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
   template <class _K2, enable_if_t<__is_transparent_v<hasher, _K2> && __is_transparent_v<key_equal, _K2>>* = nullptr>
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
+  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const _LIBCPP_LIFETIMEBOUND {
     return __table_.__equal_range_multi(__k);
   }
 #endif // _LIBCPP_STD_VER >= 20
@@ -1505,12 +1505,12 @@ public:
   _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const { return __table_.bucket_size(__n); }
   _LIBCPP_HIDE_FROM_ABI size_type bucket(const key_type& __k) const { return __table_.bucket(__k); }
 
-  _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) { return __table_.begin(__n); }
-  _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) { return __table_.end(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const { return __table_.cbegin(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const { return __table_.cend(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const { return __table_.cbegin(__n); }
-  _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const { return __table_.cend(__n); }
+  _LIBCPP_HIDE_FROM_ABI local_iterator begin(size_type __n) _LIBCPP_LIFETIMEBOUND { return __table_.begin(__n); }
+  _LIBCPP_HIDE_FROM_ABI local_iterator end(size_type __n) _LIBCPP_LIFETIMEBOUND { return __table_.end(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator begin(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cbegin(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator end(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cend(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator cbegin(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cbegin(__n); }
+  _LIBCPP_HIDE_FROM_ABI const_local_iterator cend(size_type __n) const _LIBCPP_LIFETIMEBOUND { return __table_.cend(__n); }
 
   _LIBCPP_HIDE_FROM_ABI float load_factor() const _NOEXCEPT { return __table_.load_factor(); }
   _LIBCPP_HIDE_FROM_ABI float max_load_factor() const _NOEXCEPT { return __table_.max_load_factor(); }
diff --git a/libcxx/include/valarray b/libcxx/include/valarray
index b3b48958f92bd7..91464174102ab8 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -47,8 +47,8 @@ public:
     valarray& operator=(const indirect_array<value_type>& ia);
 
     // element access:
-    const value_type& operator[](size_t i) const;
-    value_type&       operator[](size_t i);
+    const value_type& operator[](size_t i) const _LIBCPP_LIFETIMEBOUND;
+    value_type&       operator[](size_t i) _LIBCPP_LIFETIMEBOUND;
 
     // subset operations:
     valarray                   operator[](slice s) const;
@@ -417,16 +417,16 @@ template <class _Tp>
 class _LIBCPP_TEMPLATE_VIS indirect_array;
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _Tp* begin(valarray<_Tp>& __v);
+_LIBCPP_HIDE_FROM_ABI _Tp* begin(valarray<_Tp>& __v) _LIBCPP_LIFETIMEBOUND;
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI const _Tp* begin(const valarray<_Tp>& __v);
+_LIBCPP_HIDE_FROM_ABI const _Tp* begin(const valarray<_Tp>& __v) _LIBCPP_LIFETIMEBOUND;
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _Tp* end(valarray<_Tp>& __v);
+_LIBCPP_HIDE_FROM_ABI _Tp* end(valarray<_Tp>& __v) _LIBCPP_LIFETIMEBOUND;
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI const _Tp* end(const valarray<_Tp>& __v);
+_LIBCPP_HIDE_FROM_ABI const _Tp* end(const valarray<_Tp>& __v) _LIBCPP_LIFETIMEBOUND;
 
 template <class _Op, class _A0>
 struct _UnaryOp {
@@ -819,9 +819,9 @@ public:
   _LIBCPP_HIDE_FROM_ABI valarray& operator=(const __val_expr<_ValExpr>& __v);
 
   // element access:
-  _LIBCPP_HIDE_FROM_ABI const value_type& operator[](size_t __i) const { return __begin_[__i]; }
+  _LIBCPP_HIDE_FROM_ABI const value_type& operator[](size_t __i) const _LIBCPP_LIFETIMEBOUND { return __begin_[__i]; }
 
-  _LIBCPP_HIDE_FROM_ABI value_type& operator[](size_t __i) { return __begin_[__i]; }
+  _LIBCPP_HIDE_FROM_ABI value_type& operator[](size_t __i) _LIBCPP_LIFETIMEBOUND { return __begin_[__i]; }
 
   // subset operations:
   _LIBCPP_HIDE_FROM_ABI __val_expr<__slice_expr<const valarray&> > operator[](slice __s) const;
@@ -927,16 +927,16 @@ private:
   friend class __val_expr;
 
   template <class _Up>
-  friend _Up* begin(valarray<_Up>& __v);
+  friend _Up* begin(valarray<_Up>& __v) _LIBCPP_LIFETIMEBOUND;
 
   template <class _Up>
-  friend const _Up* begin(const valarray<_Up>& __v);
+  friend const _Up* begin(const valarray<_Up>& __v) _LIBCPP_LIFETIMEBOUND;
 
   template <class _Up>
-  friend _Up* end(valarray<_Up>& __v);
+  friend _Up* end(valarray<_Up>& __v) _LIBCPP_LIFETIMEBOUND;
 
   template <class _Up>
-  friend const _Up* end(const valarray<_Up>& __v);
+  friend const _Up* end(const valarray<_Up>& __v) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_HIDE_FROM_ABI void __clear(size_t __capacity);
   valarray& __assign_range(const value_type* __f, const value_type* __l);
@@ -3328,22 +3328,22 @@ tanh(const _Expr& __x) {
 }
 
 template <class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI _Tp* begin(valarray<_Tp>& __v) {
+inline _LIBCPP_HIDE_FROM_ABI _Tp* begin(valarray<_Tp>& __v) _LIBCPP_LIFETIMEBOUND {
   return __v.__begin_;
 }
 
 template <class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI const _Tp* begin(const valarray<_Tp>& __v) {
+inline _LIBCPP_HIDE_FROM_ABI const _Tp* begin(const valarray<_Tp>& __v) _LIBCPP_LIFETIMEBOUND {
   return __v.__begin_;
 }
 
 template <class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI _Tp* end(valarray<_Tp>& __v) {
+inline _LIBCPP_HIDE_FROM_ABI _Tp* end(valarray<_Tp>& __v) _LIBCPP_LIFETIMEBOUND {
   return __v.__end_;
 }
 
 template <class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI const _Tp* end(const valarray<_Tp>& __v) {
+inline _LIBCPP_HIDE_FROM_ABI const _Tp* end(const valarray<_Tp>& __v) _LIBCPP_LIFETIMEBOUND {
   return __v.__end_;
 }
 
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 2e158a4eea3145..b051d109bd8a0b 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -53,17 +53,17 @@ namespace std {
 
     // 20.7.2.4, modifiers
     template <class T, class... Args>
-    constexpr T& emplace(Args&&...);                                  // constexpr since c++20
+    constexpr T& emplace(Args&&...) _LIBCPP_LIFETIMEBOUND;                                  // constexpr since c++20
 
     template <class T, class U, class... Args>
-    constexpr T& emplace(initializer_list<U>, Args&&...);             // constexpr since c++20
+    constexpr T& emplace(initializer_list<U>, Args&&...) _LIBCPP_LIFETIMEBOUND;             // constexpr since c++20
 
     template <size_t I, class... Args>
-    constexpr variant_alternative_t<I, variant>& emplace(Args&&...);  // constexpr since c++20
+    constexpr variant_alternative_t<I, variant>& emplace(Args&&...) _LIBCPP_LIFETIMEBOUND;  // constexpr since c++20
 
     template <size_t I, class U, class...  Args>
     constexpr variant_alternative_t<I, variant>&
-        emplace(initializer_list<U>, Args&&...);                      // constexpr since c++20
+        emplace(initializer_list<U>, Args&&...) _LIBCPP_LIFETIMEBOUND;                      // constexpr since c++20
 
     // 20.7.2.5, value status
     constexpr bool valueless_by_exception() const noexcept;
@@ -302,7 +302,7 @@ struct __farray {
   static_assert(_Size > 0, "N-dimensional array should never be empty in std::visit");
   _Tp __buf_[_Size] = {};
 
-  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __n) const noexcept { return __buf_[__n]; }
+  _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __n) const noexcept _LIBCPP_LIFETIMEBOUND { return __buf_[__n]; }
 };
 
 [[noreturn]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS void
@@ -1254,7 +1254,7 @@ public:
              enable_if_t<(_Ip < sizeof...(_Types)), int>         = 0,
              class _Tp                                           = variant_alternative_t<_Ip, variant<_Types...>>,
              enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __impl_.template __emplace<_Ip>(std::forward<_Args>(__args)...);
   }
 
@@ -1264,7 +1264,7 @@ public:
              enable_if_t<(_Ip < sizeof...(_Types)), int> = 0,
              class _Tp                                   = variant_alternative_t<_Ip, variant<_Types...>>,
              enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __impl_.template __emplace<_Ip>(__il, std::forward<_Args>(__args)...);
   }
 
@@ -1272,7 +1272,7 @@ public:
              class... _Args,
              size_t _Ip = __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
              enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __impl_.template __emplace<_Ip>(std::forward<_Args>(__args)...);
   }
 
@@ -1281,7 +1281,7 @@ public:
              class... _Args,
              size_t _Ip = __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
              enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>, int> = 0>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return __impl_.template __emplace<_Ip>(__il, std::forward<_Args>(__args)...);
   }
 
diff --git a/libcxx/include/vector b/libcxx/include/vector
index dc31f31838264c..33328ed111927e 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -66,18 +66,18 @@ public:
 
     allocator_type get_allocator() const noexcept;
 
-    iterator               begin() noexcept;
-    const_iterator         begin()   const noexcept;
-    iterator               end() noexcept;
-    const_iterator         end()     const noexcept;
+    iterator               begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         begin()   const noexcept _LIBCPP_LIFETIMEBOUND;
+    iterator               end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         end()     const noexcept _LIBCPP_LIFETIMEBOUND;
 
     reverse_iterator       rbegin() noexcept;
     const_reverse_iterator rbegin()  const noexcept;
     reverse_iterator       rend() noexcept;
     const_reverse_iterator rend()    const noexcept;
 
-    const_iterator         cbegin()  const noexcept;
-    const_iterator         cend()    const noexcept;
+    const_iterator         cbegin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         cend()    const noexcept _LIBCPP_LIFETIMEBOUND;
     const_reverse_iterator crbegin() const noexcept;
     const_reverse_iterator crend()   const noexcept;
 
@@ -88,15 +88,15 @@ public:
     void reserve(size_type n);
     void shrink_to_fit() noexcept;
 
-    reference       operator[](size_type n);
-    const_reference operator[](size_type n) const;
+    reference       operator[](size_type n) _LIBCPP_LIFETIMEBOUND;
+    const_reference operator[](size_type n) const _LIBCPP_LIFETIMEBOUND;
     reference       at(size_type n);
     const_reference at(size_type n) const;
 
-    reference       front();
-    const_reference front() const;
-    reference       back();
-    const_reference back() const;
+    reference       front() _LIBCPP_LIFETIMEBOUND;
+    const_reference front() const _LIBCPP_LIFETIMEBOUND;
+    reference       back() _LIBCPP_LIFETIMEBOUND;
+    const_reference back() const _LIBCPP_LIFETIMEBOUND;
 
     value_type*       data() noexcept;
     const value_type* data() const noexcept;
@@ -104,23 +104,23 @@ public:
     void push_back(const value_type& x);
     void push_back(value_type&& x);
     template <class... Args>
-        reference emplace_back(Args&&... args); // reference in C++17
+        reference emplace_back(Args&&... args) _LIBCPP_LIFETIMEBOUND; // reference in C++17
     template<container-compatible-range<T> R>
       constexpr void append_range(R&& rg); // C++23
     void pop_back();
 
-    template <class... Args> iterator emplace(const_iterator position, Args&&... args);
-    iterator insert(const_iterator position, const value_type& x);
-    iterator insert(const_iterator position, value_type&& x);
-    iterator insert(const_iterator position, size_type n, const value_type& x);
+    template <class... Args> iterator emplace(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, const value_type& x) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, value_type&& x) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, size_type n, const value_type& x) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
-        iterator insert(const_iterator position, InputIterator first, InputIterator last);
+        iterator insert(const_iterator position, InputIterator first, InputIterator last) _LIBCPP_LIFETIMEBOUND;
     template<container-compatible-range<T> R>
-      constexpr iterator insert_range(const_iterator position, R&& rg); // C++23
-    iterator insert(const_iterator position, initializer_list<value_type> il);
+      constexpr iterator insert_range(const_iterator position, R&& rg) _LIBCPP_LIFETIMEBOUND; // C++23
+    iterator insert(const_iterator position, initializer_list<value_type> il) _LIBCPP_LIFETIMEBOUND;
 
-    iterator erase(const_iterator position);
-    iterator erase(const_iterator first, const_iterator last);
+    iterator erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
 
     void clear() noexcept;
 
@@ -197,18 +197,18 @@ public:
 
     allocator_type get_allocator() const noexcept;
 
-    iterator               begin() noexcept;
-    const_iterator         begin()   const noexcept;
-    iterator               end() noexcept;
-    const_iterator         end()     const noexcept;
+    iterator               begin() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         begin()   const noexcept _LIBCPP_LIFETIMEBOUND;
+    iterator               end() noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         end()     const noexcept _LIBCPP_LIFETIMEBOUND;
 
     reverse_iterator       rbegin() noexcept;
     const_reverse_iterator rbegin()  const noexcept;
     reverse_iterator       rend() noexcept;
     const_reverse_iterator rend()    const noexcept;
 
-    const_iterator         cbegin()  const noexcept;
-    const_iterator         cend()    const noexcept;
+    const_iterator         cbegin()  const noexcept _LIBCPP_LIFETIMEBOUND;
+    const_iterator         cend()    const noexcept _LIBCPP_LIFETIMEBOUND;
     const_reverse_iterator crbegin() const noexcept;
     const_reverse_iterator crend()   const noexcept;
 
@@ -219,33 +219,33 @@ public:
     void reserve(size_type n);
     void shrink_to_fit() noexcept;
 
-    reference       operator[](size_type n);
-    const_reference operator[](size_type n) const;
+    reference       operator[](size_type n) _LIBCPP_LIFETIMEBOUND;
+    const_reference operator[](size_type n) const _LIBCPP_LIFETIMEBOUND;
     reference       at(size_type n);
     const_reference at(size_type n) const;
 
-    reference       front();
-    const_reference front() const;
-    reference       back();
-    const_reference back() const;
+    reference       front() _LIBCPP_LIFETIMEBOUND;
+    const_reference front() const _LIBCPP_LIFETIMEBOUND;
+    reference       back() _LIBCPP_LIFETIMEBOUND;
+    const_reference back() const _LIBCPP_LIFETIMEBOUND;
 
     void push_back(const value_type& x);
-    template <class... Args> reference emplace_back(Args&&... args);  // C++14; reference in C++17
+    template <class... Args> reference emplace_back(Args&&... args) _LIBCPP_LIFETIMEBOUND;  // C++14; reference in C++17
     template<container-compatible-range<T> R>
       constexpr void append_range(R&& rg); // C++23
     void pop_back();
 
-    template <class... Args> iterator emplace(const_iterator position, Args&&... args);  // C++14
-    iterator insert(const_iterator position, const value_type& x);
-    iterator insert(const_iterator position, size_type n, const value_type& x);
+    template <class... Args> iterator emplace(const_iterator position, Args&&... args) _LIBCPP_LIFETIMEBOUND;  // C++14
+    iterator insert(const_iterator position, const value_type& x) _LIBCPP_LIFETIMEBOUND;
+    iterator insert(const_iterator position, size_type n, const value_type& x) _LIBCPP_LIFETIMEBOUND;
     template <class InputIterator>
-        iterator insert(const_iterator position, InputIterator first, InputIterator last);
+        iterator insert(const_iterator position, InputIterator first, InputIterator last) _LIBCPP_LIFETIMEBOUND;
     template<container-compatible-range<T> R>
-      constexpr iterator insert_range(const_iterator position, R&& rg); // C++23
-    iterator insert(const_iterator position, initializer_list<value_type> il);
+      constexpr iterator insert_range(const_iterator position, R&& rg) _LIBCPP_LIFETIMEBOUND; // C++23
+    iterator insert(const_iterator position, initializer_list<value_type> il) _LIBCPP_LIFETIMEBOUND;
 
-    iterator erase(const_iterator position);
-    iterator erase(const_iterator first, const_iterator last);
+    iterator erase(const_iterator position) _LIBCPP_LIFETIMEBOUND;
+    iterator erase(const_iterator first, const_iterator last) _LIBCPP_LIFETIMEBOUND;
 
     void clear() noexcept;
 
@@ -621,10 +621,10 @@ public:
     return this->__alloc();
   }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT;
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT;
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT;
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT {
     return reverse_iterator(end());
@@ -639,8 +639,8 @@ public:
     return const_reverse_iterator(begin());
   }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return begin(); }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return end(); }
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT {
     return rbegin();
   }
@@ -659,24 +659,24 @@ public:
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __n) _NOEXCEPT;
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __n) const _NOEXCEPT;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __n) _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __n) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND;
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference at(size_type __n);
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const;
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT {
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
     return *this->__begin_;
   }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
     return *this->__begin_;
   }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT {
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
     return *(this->__end_ - 1);
   }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
     return *(this->__end_ - 1);
   }
@@ -697,7 +697,7 @@ public:
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
 #if _LIBCPP_STD_VER >= 17
   reference
-  emplace_back(_Args&&... __args);
+  emplace_back(_Args&&... __args) _LIBCPP_LIFETIMEBOUND;
 #else
   void
   emplace_back(_Args&&... __args);
@@ -712,25 +712,25 @@ public:
 
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back();
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, const_reference __x);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, const_reference __x) _LIBCPP_LIFETIMEBOUND;
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, value_type&& __x);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, value_type&& __x) _LIBCPP_LIFETIMEBOUND;
   template <class... _Args>
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __position, _Args&&... __args);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __position, _Args&&... __args) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
-  insert(const_iterator __position, size_type __n, const_reference __x);
+  insert(const_iterator __position, size_type __n, const_reference __x) _LIBCPP_LIFETIMEBOUND;
 
   template <class _InputIterator,
             __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value &&
                               is_constructible< value_type, typename iterator_traits<_InputIterator>::reference>::value,
                           int> = 0>
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
-  insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
+  insert(const_iterator __position, _InputIterator __first, _InputIterator __last) _LIBCPP_LIFETIMEBOUND;
 
 #if _LIBCPP_STD_VER >= 23
   template <_ContainerCompatibleRange<_Tp> _Range>
-  _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
+  _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
     if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
       auto __n = static_cast<size_type>(ranges::distance(__range));
       return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
@@ -747,17 +747,17 @@ public:
                         is_constructible< value_type, typename iterator_traits<_ForwardIterator>::reference>::value,
                     int> = 0>
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
-  insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
+  insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last) _LIBCPP_LIFETIMEBOUND;
 
 #ifndef _LIBCPP_CXX03_LANG
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator
-  insert(const_iterator __position, initializer_list<value_type> __il) {
+  insert(const_iterator __position, initializer_list<value_type> __il) _LIBCPP_LIFETIMEBOUND {
     return insert(__position, __il.begin(), __il.end());
   }
 #endif
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __position);
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __position) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {
     size_type __old_size = size();
@@ -2048,10 +2048,10 @@ public:
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void reserve(size_type __n);
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void shrink_to_fit() _NOEXCEPT;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT { return __make_iter(0); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT { return __make_iter(0); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT { return __make_iter(__size_); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __make_iter(0); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __make_iter(0); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __make_iter(__size_); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return __make_iter(__size_);
   }
 
@@ -2068,8 +2068,8 @@ public:
     return const_reverse_iterator(begin());
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT { return __make_iter(0); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cend() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cbegin() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return __make_iter(0); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return __make_iter(__size_);
   }
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crbegin() const _NOEXCEPT {
@@ -2077,17 +2077,17 @@ public:
   }
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __n) { return __make_ref(__n); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __n) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __n) _LIBCPP_LIFETIMEBOUND { return __make_ref(__n); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __n) const _LIBCPP_LIFETIMEBOUND {
     return __make_ref(__n);
   }
   _LIBCPP_HIDE_FROM_ABI reference at(size_type __n);
   _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() { return __make_ref(0); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const { return __make_ref(0); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() { return __make_ref(__size_ - 1); }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const { return __make_ref(__size_ - 1); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() _LIBCPP_LIFETIMEBOUND { return __make_ref(0); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const _LIBCPP_LIFETIMEBOUND { return __make_ref(0); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() _LIBCPP_LIFETIMEBOUND { return __make_ref(__size_ - 1); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const _LIBCPP_LIFETIMEBOUND { return __make_ref(__size_ - 1); }
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void push_back(const value_type& __x);
 #if _LIBCPP_STD_VER >= 14
@@ -2116,14 +2116,14 @@ public:
 
 #if _LIBCPP_STD_VER >= 14
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator emplace(const_iterator __position, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator emplace(const_iterator __position, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
     return insert(__position, value_type(std::forward<_Args>(__args)...));
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, const value_type& __x);
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, const value_type& __x) _LIBCPP_LIFETIMEBOUND;
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
-  insert(const_iterator __position, size_type __n, const value_type& __x);
+  insert(const_iterator __position, size_type __n, const value_type& __x) _LIBCPP_LIFETIMEBOUND;
   template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
   iterator _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
   insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
@@ -2133,7 +2133,7 @@ public:
 
 #if _LIBCPP_STD_VER >= 23
   template <_ContainerCompatibleRange<bool> _Range>
-  _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) {
+  _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND {
     if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
       auto __n = static_cast<size_type>(ranges::distance(__range));
       return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n);
@@ -2146,13 +2146,13 @@ public:
 
 #ifndef _LIBCPP_CXX03_LANG
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
-  insert(const_iterator __position, initializer_list<value_type> __il) {
+  insert(const_iterator __position, initializer_list<value_type> __il) _LIBCPP_LIFETIMEBOUND {
     return insert(__position, __il.begin(), __il.end());
   }
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __position);
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __first, const_iterator __last);
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __position) _LIBCPP_LIFETIMEBOUND;
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator erase(const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND;
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void clear() _NOEXCEPT { __size_ = 0; }
 



More information about the libcxx-commits mailing list