diff --git a/libcxx/include/__chrono/tzdb_list.h b/libcxx/include/__chrono/tzdb_list.h index bb140128364f3b9..3a3870e3c44c391 100644 --- a/libcxx/include/__chrono/tzdb_list.h +++ b/libcxx/include/__chrono/tzdb_list.h @@ -55,12 +55,16 @@ class _LIBCPP_AVAILABILITY_TZDB tzdb_list { [[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) _LIBCPP_LIFETIMEBOUND { 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 _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 _LIBCPP_LIFETIMEBOUND { return __cbegin(); } + [[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 883b60008a02323..3f48bd325cb9ea7 100644 --- a/libcxx/include/__expected/expected.h +++ b/libcxx/include/__expected/expected.h @@ -722,7 +722,8 @@ class expected : private __expected_base<_Tp, _Err> { template 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_LIFETIMEBOUND { + _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/__mdspan/extents.h b/libcxx/include/__mdspan/extents.h index c7fda349cf4b10c..37e75e73a46d834 100644 --- a/libcxx/include/__mdspan/extents.h +++ b/libcxx/include/__mdspan/extents.h @@ -79,7 +79,9 @@ template struct __possibly_empty_array { _Tp __vals_[_Size]; _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]; } + _LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t __index) const _LIBCPP_LIFETIMEBOUND { + return __vals_[__index]; + } }; template diff --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h index e547da76c487a52..8f054e4210717fd 100644 --- a/libcxx/include/__memory/unique_ptr.h +++ b/libcxx/include/__memory/unique_ptr.h @@ -275,7 +275,9 @@ 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 _LIBCPP_LIFETIMEBOUND { 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 +587,9 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> "unique_ptr::operator[](index): index out of range"); return __ptr_[__i]; } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer get() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { 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 39204bf38f8ed7e..26fc69f9b510071 100644 --- a/libcxx/include/__node_handle +++ b/libcxx/include/__node_handle @@ -170,7 +170,9 @@ template struct __set_node_handle_specifics { typedef typename _NodeType::__node_value_type value_type; - _LIBCPP_HIDE_FROM_ABI value_type& value() const _LIBCPP_LIFETIMEBOUND { 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 diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer index 147e471852aee45..c30744df652c712 100644 --- a/libcxx/include/__split_buffer +++ b/libcxx/include/__split_buffer @@ -114,11 +114,17 @@ 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 _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 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 _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 const_iterator end() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { + return __end_; + } _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __destruct_at_end(__begin_); } @@ -141,9 +147,13 @@ public: } _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 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 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/__thread/thread.h b/libcxx/include/__thread/thread.h index c9593a8dd7ce6b2..0273ab99acc30bb 100644 --- a/libcxx/include/__thread/thread.h +++ b/libcxx/include/__thread/thread.h @@ -82,7 +82,9 @@ class __thread_specific_ptr { __thread_specific_ptr& operator=(const __thread_specific_ptr&) = delete; ~__thread_specific_ptr(); - _LIBCPP_HIDE_FROM_ABI pointer get() const _LIBCPP_LIFETIMEBOUND { 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 607ce57eafa0d45..87a386c132236d3 100644 --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -962,7 +962,9 @@ private: public: _LIBCPP_HIDE_FROM_ABI const size_type& size() const _NOEXCEPT { return __size_; } _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_; } + _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 { @@ -995,9 +997,13 @@ public: _LIBCPP_HIDE_FROM_ABI ~__tree(); _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 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 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(__node_traits::max_size(__node_alloc()), numeric_limits::max()); diff --git a/libcxx/include/__vector/vector.h b/libcxx/include/__vector/vector.h index 93b74c587834bb3..42e8236bb489447 100644 --- a/libcxx/include/__vector/vector.h +++ b/libcxx/include/__vector/vector.h @@ -317,12 +317,18 @@ class _LIBCPP_TEMPLATE_VIS vector { return const_reverse_iterator(begin()); } - _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_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 _LIBCPP_LIFETIMEBOUND { return rbegin(); } - _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return rend(); } + _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { + return rend(); + } _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return static_cast(this->__end_ - this->__begin_); @@ -337,8 +343,10 @@ class _LIBCPP_TEMPLATE_VIS vector { _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_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 + 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_LIFETIMEBOUND; _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const _LIBCPP_LIFETIMEBOUND; @@ -390,11 +398,14 @@ class _LIBCPP_TEMPLATE_VIS vector { _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_LIFETIMEBOUND; + _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_LIFETIMEBOUND; + _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __position, value_type&& __x) + _LIBCPP_LIFETIMEBOUND; template - _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 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) _LIBCPP_LIFETIMEBOUND; @@ -408,7 +419,8 @@ class _LIBCPP_TEMPLATE_VIS vector { #if _LIBCPP_STD_VER >= 23 template <_ContainerCompatibleRange<_Tp> _Range> - _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND { + _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(ranges::distance(__range)); return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n); @@ -435,7 +447,8 @@ class _LIBCPP_TEMPLATE_VIS vector { #endif _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 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(); diff --git a/libcxx/include/__vector/vector_bool.h b/libcxx/include/__vector/vector_bool.h index 3e936160eaa7c30..4c7d968b3faa831 100644 --- a/libcxx/include/__vector/vector_bool.h +++ b/libcxx/include/__vector/vector_bool.h @@ -254,9 +254,15 @@ class _LIBCPP_TEMPLATE_VIS vector { _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 _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 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_); } @@ -274,7 +280,9 @@ class _LIBCPP_TEMPLATE_VIS vector { return const_reverse_iterator(begin()); } - _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 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_); } @@ -283,17 +291,26 @@ class _LIBCPP_TEMPLATE_VIS vector { } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return rend(); } - _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 { + _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_LIFETIMEBOUND; _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const _LIBCPP_LIFETIMEBOUND; _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 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 @@ -322,12 +339,14 @@ class _LIBCPP_TEMPLATE_VIS vector { #if _LIBCPP_STD_VER >= 14 template - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator emplace(const_iterator __position, _Args&&... __args) _LIBCPP_LIFETIMEBOUND { + _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_LIFETIMEBOUND; + _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) _LIBCPP_LIFETIMEBOUND; template ::value, int> = 0> @@ -339,7 +358,8 @@ class _LIBCPP_TEMPLATE_VIS vector { #if _LIBCPP_STD_VER >= 23 template <_ContainerCompatibleRange _Range> - _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND { + _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(ranges::distance(__range)); return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n); @@ -358,7 +378,8 @@ class _LIBCPP_TEMPLATE_VIS vector { #endif _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 iterator erase(const_iterator __first, const_iterator __last) + _LIBCPP_LIFETIMEBOUND; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void clear() _NOEXCEPT { __size_ = 0; } diff --git a/libcxx/include/array b/libcxx/include/array index 20468473aeb7f2d..b19086a9b0595b2 100644 --- a/libcxx/include/array +++ b/libcxx/include/array @@ -201,11 +201,15 @@ struct _LIBCPP_TEMPLATE_VIS array { } // iterators: - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(data()); } + _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 _LIBCPP_LIFETIMEBOUND { return iterator(data() + _Size); } + _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,12 +227,18 @@ struct _LIBCPP_TEMPLATE_VIS array { return const_reverse_iterator(begin()); } - _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_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 _LIBCPP_LIFETIMEBOUND { return rbegin(); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return rend(); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { + return rend(); + } // capacity: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT { return _Size; } @@ -236,11 +246,13 @@ 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_LIFETIMEBOUND { + _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"); return __elems_[__n]; } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference operator[](size_type __n) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { + _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"); return __elems_[__n]; } @@ -257,9 +269,15 @@ struct _LIBCPP_TEMPLATE_VIS array { return __elems_[__n]; } - _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_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,11 +327,15 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> { } // iterators: - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(data()); } + _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 _LIBCPP_LIFETIMEBOUND { return iterator(data()); } + _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,9 +353,19 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> { return const_reverse_iterator(begin()); } +<<<<<<< HEAD _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 _LIBCPP_LIFETIMEBOUND { +======= + _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 { +>>>>>>> ca0c852bfd44 (Fix whitespace, add a couple of tests for [[clang::lifetimebound]] annotations in libc++, and avoid erroring on lifetimebound warnings in libcxx test code) return rbegin(); } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const_reverse_iterator crend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return rend(); } @@ -349,7 +381,8 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> { __libcpp_unreachable(); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference operator[](size_type) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { + _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::operator[] on a zero-sized array"); __libcpp_unreachable(); } diff --git a/libcxx/include/deque b/libcxx/include/deque index da38e15d42246a6..3ac6e5f59515907 100644 --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -811,7 +811,8 @@ public: _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InputIter __f, _InputIter __l) _LIBCPP_LIFETIMEBOUND; template ::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l) _LIBCPP_LIFETIMEBOUND; + _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l) + _LIBCPP_LIFETIMEBOUND; template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _BiIter __f, _BiIter __l) _LIBCPP_LIFETIMEBOUND; diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map index 5107d05ba51d530..ef179fbffb9ff45 100644 --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -519,7 +519,9 @@ public: _LIBCPP_HIDE_FROM_ABI std::pair insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_unique(__x); } - _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x).first; } + _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { + return insert(__x).first; + } template _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last); @@ -536,12 +538,15 @@ public: _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) _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 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 equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_unique(__k); } - _LIBCPP_HIDE_FROM_ABI std::pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI std::pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_unique(__k); } @@ -741,8 +746,12 @@ public: _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) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_multi(__x); } - _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { 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 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last); @@ -759,12 +768,15 @@ public: _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) _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 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 equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_multi(__k); } - _LIBCPP_HIDE_FROM_ABI std::pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI std::pair + 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 066516e78aaa2de..1f00ef2331ed971 100644 --- a/libcxx/include/ext/hash_set +++ b/libcxx/include/ext/hash_set @@ -278,7 +278,9 @@ public: _LIBCPP_HIDE_FROM_ABI std::pair insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_unique(__x); } - _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x).first; } + _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { + return insert(__x).first; + } template _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last); @@ -293,12 +295,15 @@ public: _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); } _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 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 equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_unique(__k); } - _LIBCPP_HIDE_FROM_ABI std::pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI std::pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_unique(__k); } @@ -455,8 +460,12 @@ public: _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) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_multi(__x); } - _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { 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 _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last); @@ -471,12 +480,15 @@ public: _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); } _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 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 equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_multi(__k); } - _LIBCPP_HIDE_FROM_ABI std::pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI std::pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_multi(__k); } diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list index d7ca51423dfeb56..3bdb311e8238c2c 100644 --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -740,7 +740,9 @@ public: _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return allocator_type(__base::__alloc()); } - _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(__base::__before_begin()->__next_); } + _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_); } @@ -752,7 +754,9 @@ public: } _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return const_iterator(nullptr); } - _LIBCPP_HIDE_FROM_ABI iterator before_begin() _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return iterator(__base::__before_begin()); } + _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()); } @@ -767,8 +771,12 @@ public: return std::min(__node_traits::max_size(__base::__alloc()), numeric_limits::max()); } - _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(); } + _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 @@ -796,14 +804,17 @@ public: _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_LIFETIMEBOUND; - _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, initializer_list __il) _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, initializer_list __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_LIFETIMEBOUND; - _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, size_type __n, 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 ::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l) _LIBCPP_LIFETIMEBOUND; + _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> diff --git a/libcxx/include/list b/libcxx/include/list index d2b2f92b63657d9..ccfefcc89457ae1 100644 --- a/libcxx/include/list +++ b/libcxx/include/list @@ -525,9 +525,13 @@ protected: _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __sz() == 0; } _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 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 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 diff --git a/libcxx/include/map b/libcxx/include/map index ad9c737e0cd72a4..cc5c328366aff12 100644 --- a/libcxx/include/map +++ b/libcxx/include/map @@ -1191,7 +1191,9 @@ public: #endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __v) _LIBCPP_LIFETIMEBOUND { return __tree_.__insert_unique(__v); } + _LIBCPP_HIDE_FROM_ABI pair 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.__i_, __v); @@ -1290,7 +1292,8 @@ public: } template - _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND { + _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) @@ -1366,7 +1369,9 @@ 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) _LIBCPP_LIFETIMEBOUND { return __tree_.find(__k); } - _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _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 , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -1394,8 +1399,12 @@ public: } #endif // _LIBCPP_STD_VER >= 20 - _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); } + _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 , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -1408,8 +1417,12 @@ public: } #endif - _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); } + _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 , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -1424,7 +1437,8 @@ public: _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.__equal_range_unique(__k); } - _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.__equal_range_unique(__k); } #if _LIBCPP_STD_VER >= 14 @@ -1870,7 +1884,9 @@ public: return __tree_.__insert_multi(__pos.__i_, std::forward<_Pp>(__p)); } - _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) _LIBCPP_LIFETIMEBOUND { 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_LIFETIMEBOUND { return __tree_.__insert_multi(__p.__i_, std::move(__v)); @@ -1880,7 +1896,9 @@ public: #endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) _LIBCPP_LIFETIMEBOUND { 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_LIFETIMEBOUND { return __tree_.__insert_multi(__p.__i_, __v); @@ -1959,7 +1977,9 @@ public: } _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); } + _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + return __tree_.find(__k); + } #if _LIBCPP_STD_VER >= 14 template , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -1987,8 +2007,12 @@ public: } #endif // _LIBCPP_STD_VER >= 20 - _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); } + _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 , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -2001,8 +2025,12 @@ public: } #endif - _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); } + _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 , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -2017,7 +2045,8 @@ public: _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.__equal_range_multi(__k); } - _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.__equal_range_multi(__k); } #if _LIBCPP_STD_VER >= 14 diff --git a/libcxx/include/optional b/libcxx/include/optional index 094c216df2c883b..131a5aa55217b46 100644 --- a/libcxx/include/optional +++ b/libcxx/include/optional @@ -766,7 +766,8 @@ public: template &, _Args...> > > - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) _LIBCPP_LIFETIMEBOUND { + _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/regex b/libcxx/include/regex index 74a43c5fbf88e72..26dd6039dda6e76 100644 --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -4614,9 +4614,13 @@ public: return __suffix_; } - _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _LIBCPP_LIFETIMEBOUND { return empty() ? __matches_.end() : __matches_.begin(); } + _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 cbegin() const _LIBCPP_LIFETIMEBOUND { + return empty() ? __matches_.end() : __matches_.begin(); + } _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _LIBCPP_LIFETIMEBOUND { return __matches_.end(); } // format: diff --git a/libcxx/include/set b/libcxx/include/set index a3266de2782973e..4594424464cd9e6 100644 --- a/libcxx/include/set +++ b/libcxx/include/set @@ -739,7 +739,9 @@ public: } #endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __v) _LIBCPP_LIFETIMEBOUND { return __tree_.__insert_unique(__v); } + _LIBCPP_HIDE_FROM_ABI pair 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); } @@ -774,7 +776,9 @@ public: _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) _LIBCPP_LIFETIMEBOUND { 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 @@ -828,7 +832,9 @@ public: // set operations: _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); } + _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + return __tree_.find(__k); + } #if _LIBCPP_STD_VER >= 14 template , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -856,8 +862,12 @@ public: } #endif // _LIBCPP_STD_VER >= 20 - _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); } + _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 , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -870,8 +880,12 @@ public: } #endif - _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); } + _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 , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -886,7 +900,8 @@ public: _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.__equal_range_unique(__k); } - _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.__equal_range_unique(__k); } #if _LIBCPP_STD_VER >= 14 @@ -1204,7 +1219,9 @@ public: } #endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) _LIBCPP_LIFETIMEBOUND { 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_LIFETIMEBOUND { return __tree_.__insert_multi(__p, __v); } @@ -1226,7 +1243,9 @@ public: #endif #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) _LIBCPP_LIFETIMEBOUND { 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_LIFETIMEBOUND { return __tree_.__insert_multi(__p, std::move(__v)); @@ -1237,7 +1256,9 @@ public: _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) _LIBCPP_LIFETIMEBOUND { 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 @@ -1293,7 +1314,9 @@ public: // set operations: _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); } + _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + return __tree_.find(__k); + } #if _LIBCPP_STD_VER >= 14 template , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -1321,8 +1344,12 @@ public: } #endif // _LIBCPP_STD_VER >= 20 - _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); } + _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 , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -1335,8 +1362,12 @@ public: } #endif - _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); } + _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 , int> = 0> _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -1351,7 +1382,8 @@ public: _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __tree_.__equal_range_multi(__k); } - _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __tree_.__equal_range_multi(__k); } #if _LIBCPP_STD_VER >= 14 diff --git a/libcxx/include/string b/libcxx/include/string index 589d2e3e86633d9..3e88216c93f7d59 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -1277,12 +1277,18 @@ public: return const_reverse_iterator(begin()); } - _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_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 _LIBCPP_LIFETIMEBOUND { return rbegin(); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { return rend(); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reverse_iterator crend() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { + return rend(); + } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type size() const _NOEXCEPT { return __is_long() ? __get_long_size() : __get_short_size(); @@ -1328,7 +1334,8 @@ public: return size() == 0; } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __pos) const _NOEXCEPT _LIBCPP_LIFETIMEBOUND { + _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 +1343,8 @@ public: return *(data() + __pos); } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __pos) _NOEXCEPT _LIBCPP_LIFETIMEBOUND { + _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); @@ -1566,7 +1574,8 @@ public: #if _LIBCPP_STD_VER >= 23 template <_ContainerCompatibleRange<_CharT> _Range> - _LIBCPP_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __position, _Range&& __range) _LIBCPP_LIFETIMEBOUND { + _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(ranges::distance(__range)); return __insert_with_size(__position, ranges::begin(__range), ranges::end(__range), __n); @@ -1602,7 +1611,8 @@ public: _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_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 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/unordered_map b/libcxx/include/unordered_map index e90da7f37d1c662..a3cce6abd23fe90 100644 --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -1224,9 +1224,13 @@ public: _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 insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_unique(__x); } + _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { + return __table_.__insert_unique(__x); + } - _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x).first; } + _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { + return insert(__x).first; + } template _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last); @@ -1318,7 +1322,8 @@ public: } template - _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign(const_iterator, const key_type& __k, _Vp&& __v) _LIBCPP_LIFETIMEBOUND { + _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; } @@ -1388,7 +1393,9 @@ public: _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) _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 const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + return __table_.find(__k); + } #if _LIBCPP_STD_VER >= 20 template && __is_transparent_v>* = nullptr> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -1420,7 +1427,8 @@ public: _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_unique(__k); } - _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_unique(__k); } #if _LIBCPP_STD_VER >= 20 @@ -2033,7 +2041,9 @@ public: _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) _LIBCPP_LIFETIMEBOUND { 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_LIFETIMEBOUND { return __table_.__insert_multi(__p.__i_, __x); @@ -2053,7 +2063,9 @@ public: #ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } - _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) _LIBCPP_LIFETIMEBOUND { 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_LIFETIMEBOUND { return __table_.__insert_multi(__p.__i_, std::move(__x)); @@ -2140,7 +2152,9 @@ public: _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) _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 const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + return __table_.find(__k); + } #if _LIBCPP_STD_VER >= 20 template && __is_transparent_v>* = nullptr> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -2172,7 +2186,8 @@ public: _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_multi(__k); } - _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_multi(__k); } #if _LIBCPP_STD_VER >= 20 diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set index 007334cedd1a419..1a2f1a0aa4aab48 100644 --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -768,13 +768,19 @@ public: _LIBCPP_HIDE_FROM_ABI pair 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_LIFETIMEBOUND { 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 __il) { insert(__il.begin(), __il.end()); } #endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { return __table_.__insert_unique(__x); } + _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { + return __table_.__insert_unique(__x); + } - _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { return insert(__x).first; } + _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) _LIBCPP_LIFETIMEBOUND { + return insert(__x).first; + } template _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last); @@ -846,7 +852,9 @@ public: _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); } _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 const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + return __table_.find(__k); + } #if _LIBCPP_STD_VER >= 20 template && __is_transparent_v>* = nullptr> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -878,7 +886,8 @@ public: _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_unique(__k); } - _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_unique(__k); } #if _LIBCPP_STD_VER >= 20 @@ -1369,14 +1378,18 @@ public: return __table_.__emplace_hint_multi(__p, std::forward<_Args>(__args)...); } - _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) _LIBCPP_LIFETIMEBOUND { 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_LIFETIMEBOUND { return __table_.__insert_multi(__p, std::move(__x)); } _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } #endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) _LIBCPP_LIFETIMEBOUND { 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_LIFETIMEBOUND { return __table_.__insert_multi(__p, __x); @@ -1453,7 +1466,9 @@ public: _LIBCPP_HIDE_FROM_ABI key_equal key_eq() const { return __table_.key_eq(); } _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 const_iterator find(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + return __table_.find(__k); + } #if _LIBCPP_STD_VER >= 20 template && __is_transparent_v>* = nullptr> _LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) _LIBCPP_LIFETIMEBOUND { @@ -1485,7 +1500,8 @@ public: _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_multi(__k); } - _LIBCPP_HIDE_FROM_ABI pair equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { + _LIBCPP_HIDE_FROM_ABI pair + equal_range(const key_type& __k) const _LIBCPP_LIFETIMEBOUND { return __table_.__equal_range_multi(__k); } #if _LIBCPP_STD_VER >= 20 diff --git a/libcxx/include/variant b/libcxx/include/variant index 9592d85e473694a..aaf898959de2eb7 100644 --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -1438,7 +1438,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t<_Tp> get_if(variant<_Types...>* __ } template -_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t get_if(const variant<_Types...>* __v) noexcept _LIBCPP_LIFETIMEBOUND { +_LIBCPP_HIDE_FROM_ABI constexpr add_pointer_t +get_if(const variant<_Types...>* __v) noexcept _LIBCPP_LIFETIMEBOUND { static_assert(!is_void_v<_Tp>); return std::get_if<__find_exactly_one_t<_Tp, _Types...>::value>(__v); } diff --git a/libcxx/test/libcxx/utilities/utility/forward/lifetimebound.verify.cpp b/libcxx/test/libcxx/utilities/utility/forward/lifetimebound.verify.cpp index 4381c3af756b643..fc48ac62f625f18 100644 --- a/libcxx/test/libcxx/utilities/utility/forward/lifetimebound.verify.cpp +++ b/libcxx/test/libcxx/utilities/utility/forward/lifetimebound.verify.cpp @@ -9,6 +9,7 @@ // UNSUPPORTED: c++03 // ADDITIONAL_COMPILE_FLAGS: -Wno-pessimizing-move -Wno-unused-variable +#include #include #include "test_macros.h" @@ -25,4 +26,10 @@ void func() { #if TEST_STD_VER >= 23 auto&& v5 = std::forward_like(int{}); // expected-warning {{temporary bound to local reference 'v5' will be destroyed at the end of the full-expression}} #endif + + // expected-warning@+1 {{temporary whose address is used as value of local variable 'v6' will be destroyed at the end of the full-expression}} + auto v6 = std::set({0}).equal_range(0); + + // expected-warning@+1 {{temporary whose address is used as value of local variable 'v7' will be destroyed at the end of the full-expression}} + auto v7 = std::set().insert(0); } diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index 5ef14e54dae237c..f869810632d577f 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -10,6 +10,8 @@ #ifndef SUPPORT_TEST_MACROS_HPP #define SUPPORT_TEST_MACROS_HPP +#pragma clang diagnostic warning "-Wdangling" + #ifdef __has_include # if __has_include() # include