diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst index bf25b34ba9159..bd73a1d933cb1 100644 --- a/libcxx/docs/FeatureTestMacroTable.rst +++ b/libcxx/docs/FeatureTestMacroTable.rst @@ -418,6 +418,8 @@ Status ---------------------------------------------------------- ----------------- ``__cpp_lib_constexpr_algorithms`` ``202306L`` ---------------------------------------------------------- ----------------- + ``__cpp_lib_constexpr_deque`` ``202502L`` + ---------------------------------------------------------- ----------------- ``__cpp_lib_constexpr_new`` ``202406L`` ---------------------------------------------------------- ----------------- ``__cpp_lib_constrained_equality`` *unimplemented* diff --git a/libcxx/include/deque b/libcxx/include/deque index bab76d442a21b..1c19890911b5c 100644 --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -605,7 +605,8 @@ private: public: // construct/copy/destroy: - _LIBCPP_HIDE_FROM_ABI deque() _NOEXCEPT_(is_nothrow_default_constructible::value) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque() + _NOEXCEPT_(is_nothrow_default_constructible::value) : __start_(0), __size_(0) { __annotate_new(0); } @@ -619,19 +620,20 @@ public: __alloc_traits::deallocate(__alloc(), *__i, __block_size); } - _LIBCPP_HIDE_FROM_ABI explicit deque(const allocator_type& __a) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit deque(const allocator_type& __a) : __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) { __annotate_new(0); } explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n); # if _LIBCPP_STD_VER >= 14 - explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const _Allocator& __a); + explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(size_type __n, const _Allocator& __a); # endif _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v); template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v, const allocator_type& __a) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 + deque(size_type __n, const value_type& __v, const allocator_type& __a) : __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) { __annotate_new(0); if (__n > 0) @@ -641,11 +643,12 @@ public: template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l); template ::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(_InputIter __f, _InputIter __l, const allocator_type& __a); # if _LIBCPP_STD_VER >= 23 template <_ContainerCompatibleRange<_Tp> _Range> - _LIBCPP_HIDE_FROM_ABI deque(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type()) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 + deque(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type()) : __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) { if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) { __append_with_size(ranges::begin(__range), ranges::distance(__range)); @@ -658,8 +661,9 @@ public: } # endif - _LIBCPP_HIDE_FROM_ABI deque(const deque& __c); - _LIBCPP_HIDE_FROM_ABI deque(const deque& __c, const __type_identity_t& __a); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(const deque& __c); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 + deque(const deque& __c, const __type_identity_t& __a); _LIBCPP_HIDE_FROM_ABI deque& operator=(const deque& __c); @@ -667,13 +671,14 @@ public: _LIBCPP_HIDE_FROM_ABI deque(initializer_list __il); _LIBCPP_HIDE_FROM_ABI deque(initializer_list __il, const allocator_type& __a); - _LIBCPP_HIDE_FROM_ABI deque& operator=(initializer_list __il) { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque& operator=(initializer_list __il) { assign(__il); return *this; } - _LIBCPP_HIDE_FROM_ABI deque(deque&& __c) noexcept(is_nothrow_move_constructible::value); - _LIBCPP_HIDE_FROM_ABI deque(deque&& __c, const __type_identity_t& __a); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 + deque(deque&& __c) noexcept(is_nothrow_move_constructible::value); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(deque&& __c, const __type_identity_t& __a); _LIBCPP_HIDE_FROM_ABI deque& operator=(deque&& __c) noexcept( (__alloc_traits::propagate_on_container_move_assignment::value && is_nothrow_move_assignable::value) || @@ -709,67 +714,81 @@ public: _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v); - _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type get_allocator() const _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI allocator_type& __alloc() _NOEXCEPT { return __alloc_; } _LIBCPP_HIDE_FROM_ABI const allocator_type& __alloc() const _NOEXCEPT { return __alloc_; } // iterators: - _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() _NOEXCEPT { __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 _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const _NOEXCEPT { __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 _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() _NOEXCEPT { 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 _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const _NOEXCEPT { 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); } - _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 _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() _NOEXCEPT { + return reverse_iterator(end()); + } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const _NOEXCEPT { + return const_reverse_iterator(end()); + } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() _NOEXCEPT { + return reverse_iterator(begin()); + } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 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_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 _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const _NOEXCEPT { return begin(); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const _NOEXCEPT { return end(); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const _NOEXCEPT { + return const_reverse_iterator(end()); + } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const _NOEXCEPT { + return const_reverse_iterator(begin()); + } // capacity: - _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size(); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const _NOEXCEPT { return __size(); } _LIBCPP_HIDE_FROM_ABI size_type& __size() _NOEXCEPT { return __size_; } _LIBCPP_HIDE_FROM_ABI const size_type& __size() const _NOEXCEPT { return __size_; } - _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const _NOEXCEPT { return std::min(__alloc_traits::max_size(__alloc()), numeric_limits::max()); } - _LIBCPP_HIDE_FROM_ABI void resize(size_type __n); - _LIBCPP_HIDE_FROM_ABI void resize(size_type __n, const value_type& __v); - _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT; - [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void resize(size_type __n); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void resize(size_type __n, const value_type& __v); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void shrink_to_fit() _NOEXCEPT; + [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 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 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 _LIBCPP_CONSTEXPR_SINCE_CXX26 reference operator[](size_type __i) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference operator[](size_type __i) const _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference at(size_type __i); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference at(size_type __i) const; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference front() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference front() const _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference back() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference back() const _NOEXCEPT; // 23.2.2.3 modifiers: _LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v); @@ -789,8 +808,8 @@ public: template _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args); - _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v); - _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __v); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void push_front(value_type&& __v); + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void push_back(value_type&& __v); # if _LIBCPP_STD_VER >= 23 template <_ContainerCompatibleRange<_Tp> _Range> @@ -1570,7 +1589,7 @@ inline typename deque<_Tp, _Allocator>::const_reference deque<_Tp, _Allocator>:: } template -void deque<_Tp, _Allocator>::push_back(const value_type& __v) { +void _LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::push_back(const value_type& __v) { allocator_type& __a = __alloc(); if (__back_spare() == 0) __add_back_capacity(); @@ -1658,7 +1677,8 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args) { } template -typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v) { +_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator +deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v) { size_type __pos = __p - begin(); size_type __to_end = size() - __pos; allocator_type& __a = __alloc(); @@ -1755,7 +1775,8 @@ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::emplace(const_ # endif // _LIBCPP_CXX03_LANG template -typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v) { +_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator +deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v) { size_type __pos = __p - begin(); size_type __to_end = size() - __pos; allocator_type& __a = __alloc(); @@ -1807,7 +1828,7 @@ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_i } template -typename deque<_Tp, _Allocator>::iterator +typename deque<_Tp, _Allocator>::iterator _LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_type& __v) { size_type __pos = __p - begin(); size_type __to_end = __size() - __pos; @@ -2543,7 +2564,8 @@ inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT { } template -inline _LIBCPP_HIDE_FROM_ABI bool operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) { +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool +operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) { const typename deque<_Tp, _Allocator>::size_type __sz = __x.size(); return __sz == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin()); } @@ -2578,7 +2600,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const deque<_Tp, _Allocator>& __x, # else // _LIBCPP_STD_VER <= 17 template -_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __synth_three_way_result<_Tp> operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) { return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way); } @@ -2586,14 +2608,14 @@ operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y # endif // _LIBCPP_STD_VER <= 17 template -inline _LIBCPP_HIDE_FROM_ABI void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y) - _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) { +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void +swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) { __x.swap(__y); } # if _LIBCPP_STD_VER >= 20 template -inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::size_type erase(deque<_Tp, _Allocator>& __c, const _Up& __v) { auto __old_size = __c.size(); __c.erase(std::remove(__c.begin(), __c.end(), __v), __c.end()); @@ -2601,7 +2623,7 @@ erase(deque<_Tp, _Allocator>& __c, const _Up& __v) { } template -inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::size_type erase_if(deque<_Tp, _Allocator>& __c, _Predicate __pred) { auto __old_size = __c.size(); __c.erase(std::remove_if(__c.begin(), __c.end(), __pred), __c.end()); diff --git a/libcxx/include/version b/libcxx/include/version index 0a19ff9ad8187..e451e49fe1a3d 100644 --- a/libcxx/include/version +++ b/libcxx/include/version @@ -66,6 +66,7 @@ __cpp_lib_constexpr_bitset 202207L __cpp_lib_constexpr_charconv 202207L __cpp_lib_constexpr_cmath 202202L __cpp_lib_constexpr_complex 201711L +__cpp_lib_constexpr_deque 202502L __cpp_lib_constexpr_dynamic_alloc 201907L __cpp_lib_constexpr_functional 201907L __cpp_lib_constexpr_iterator 201811L @@ -539,6 +540,7 @@ __cpp_lib_void_t 201411L # define __cpp_lib_bitset 202306L # undef __cpp_lib_constexpr_algorithms # define __cpp_lib_constexpr_algorithms 202306L +# define __cpp_lib_constexpr_deque 202502L # if !defined(_LIBCPP_ABI_VCRUNTIME) # define __cpp_lib_constexpr_new 202406L # endif diff --git a/libcxx/test/std/containers/sequences/deque/compare.pass.cpp b/libcxx/test/std/containers/sequences/deque/compare.pass.cpp index 526e3d38e7dff..25aea88911d82 100644 --- a/libcxx/test/std/containers/sequences/deque/compare.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/compare.pass.cpp @@ -37,7 +37,7 @@ #include "test_comparisons.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { const std::deque d1, d2; assert(testComparisons(d1, d2, true, false)); @@ -113,6 +113,14 @@ int main(int, char**) { const std::deque d2(items2, items2 + 2); assert(testComparisons(d1, d2, false, false)); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/compare.three_way.pass.cpp b/libcxx/test/std/containers/sequences/deque/compare.three_way.pass.cpp index 3d5646a844951..f35ef6081c866 100644 --- a/libcxx/test/std/containers/sequences/deque/compare.three_way.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/compare.three_way.pass.cpp @@ -18,8 +18,15 @@ #include "test_container_comparisons.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { assert(test_sequence_container_spaceship()); - // `std::deque` is not constexpr, so no `static_assert` test here. + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp index 294663c5bd356..fa2ab8c2f45b1 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp @@ -47,7 +47,7 @@ C make(int size, int start = 0) { return c; } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { typedef std::deque C; C c = make >(10); @@ -118,6 +118,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } #endif + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.pass.cpp index 5e3a6ec1cea82..cb684a312067b 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.pass.cpp @@ -19,7 +19,7 @@ #include "test_macros.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { typedef std::deque C; C c; @@ -46,6 +46,13 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } #endif + return true; +} +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp index 39feabe3889b3..8043e8e030114 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp @@ -19,7 +19,7 @@ #include "test_allocator.h" #include "test_macros.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { typedef limited_allocator A; typedef std::deque C; @@ -45,6 +45,14 @@ int main(int, char**) { assert(c.max_size() <= alloc_max_size(c.get_allocator())); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp index 767fe7ae8864e..8bd735a2cedd5 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp @@ -63,7 +63,7 @@ void testN(int start, int N, int M) { test(c1, M); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -90,6 +90,14 @@ int main(int, char**) { testN>>(rng[i], rng[j], rng[k]); } #endif + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp index 0abd94759a50f..9e1d3ff39e18f 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp @@ -63,7 +63,7 @@ void testN(int start, int N, int M) { test(c1, M, -10); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -91,5 +91,13 @@ int main(int, char**) { } #endif + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp index 34eedf8d050b7..fed42d2b691c9 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp @@ -50,7 +50,7 @@ void testN(int start, int N) { test(c1); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -74,6 +74,14 @@ int main(int, char**) { testN> >(rng[i], rng[j]); } #endif + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/size.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/size.pass.cpp index 5c6a34867b39a..97219518ab4c5 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/size.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/size.pass.cpp @@ -19,7 +19,7 @@ #include "test_macros.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { typedef std::deque C; C c; @@ -72,6 +72,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } #endif + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp index 4b19ef3e22173..55bbc0652737c 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp @@ -20,23 +20,31 @@ #include "min_allocator.h" template -void test(const Allocator& a) { +void test_util(const Allocator& a) { std::deque d(a); assert(d.size() == 0); assert(d.get_allocator() == a); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d)); } -int main(int, char**) { - test(std::allocator()); - test(test_allocator(3)); +TEST_CONSTEXPR_CXX26 bool test() { + test_util(std::allocator()); + test_util(test_allocator(3)); #if TEST_STD_VER >= 11 - test(min_allocator()); - test(safe_allocator()); - test(min_allocator{}); - test(safe_allocator{}); - test(explicit_allocator()); - test(explicit_allocator{}); + test_util(min_allocator()); + test_util(safe_allocator()); + test_util(min_allocator{}); + test_util(safe_allocator{}); + test_util(explicit_allocator()); + test_util(explicit_allocator{}); +#endif + return false; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); #endif return 0; diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp index bc57098463eaa..6e2a5b1369e70 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp @@ -19,7 +19,7 @@ #include "test_macros.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { std::deque d; d.assign({3, 4, 5, 6}); @@ -40,6 +40,13 @@ int main(int, char**) { assert(d[3] == 6); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d)); } + return true; +} +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp index c57eb9d08cabe..5a1b29c02ca2e 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp @@ -144,6 +144,8 @@ void test_iterators() { int main(int, char**) { basic_test(); - +#if TEST_STD_VER >= 26 + static_assert(basic_test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp index 30277125e46e1..97857088a77e4 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp @@ -55,7 +55,7 @@ void testN(int start, int N, int M) { test(c1, M, -10); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -74,6 +74,14 @@ int main(int, char**) { testN> >(rng[i], rng[j], rng[k]); } #endif + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp index 9f7a429d122a3..4de61a8445f1c 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp @@ -26,7 +26,7 @@ void test(const C& x) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(x)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; int* an = ab + sizeof(ab) / sizeof(ab[0]); @@ -63,6 +63,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(v2)); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp index fb3ad3c25a8f1..a93a28204abab 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp @@ -26,7 +26,7 @@ void test(const C& x, const typename C::allocator_type& a) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; int* an = ab + sizeof(ab) / sizeof(ab[0]); @@ -49,6 +49,14 @@ int main(int, char**) { test(std::deque >(ab, an, safe_allocator()), safe_allocator()); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp index c481ac59ab411..995eeb578f7b2 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp @@ -32,7 +32,7 @@ struct A {}; -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { // Test the explicit deduction guides { const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; @@ -156,6 +156,14 @@ int main(int, char**) { #endif SequenceContainerDeductionGuidesSfinaeAway>(); + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/deduct.verify.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/deduct.verify.cpp index 61e58b08ca263..cbdcee4be91f5 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/deduct.verify.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/deduct.verify.cpp @@ -22,7 +22,7 @@ struct A {}; -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { // Test the explicit deduction guides // Test the implicit deduction guides @@ -34,6 +34,14 @@ int main(int, char**) { // Also, we can't use {} instead of parens, because that constructs a // deque, allocator>> } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/default.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/default.pass.cpp index 6bfd4857f9b0a..f6fa7c642ff6c 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/default.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/default.pass.cpp @@ -31,13 +31,21 @@ void test() { #endif } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { test >(); test >(); #if TEST_STD_VER >= 11 test >(); test >(); #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp index 244fef829f521..a37504dcb5568 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp @@ -29,7 +29,7 @@ struct some_alloc { void allocate(std::size_t); }; -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { #if defined(_LIBCPP_VERSION) { typedef std::deque C; @@ -48,6 +48,14 @@ int main(int, char**) { typedef std::deque> C; static_assert(!std::is_nothrow_default_constructible::value, ""); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp index f0a839484f9dc..8aa967ebe0885 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp @@ -27,7 +27,7 @@ struct some_alloc { void allocate(std::size_t); }; -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { typedef std::deque C; static_assert(std::is_nothrow_destructible::value, ""); @@ -46,6 +46,14 @@ int main(int, char**) { static_assert(!std::is_nothrow_destructible::value, ""); } #endif // _LIBCPP_VERSION + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/from_range.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/from_range.pass.cpp index cfc07ab7bc797..251d6dc18d51d 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/from_range.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/from_range.pass.cpp @@ -17,7 +17,7 @@ // template R> // deque(from_range_t, R&& rg, const Allocator& = Allocator()); // C++23 -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { for_all_iterators_and_allocators([]() { test_sequence_container([]([[maybe_unused]] const auto& c) { LIBCPP_ASSERT(c.__invariants()); @@ -31,6 +31,14 @@ int main(int, char**) { // See https://github.com/llvm/llvm-project/issues/62056. //test_exception_safety_throwing_copy(); //test_exception_safety_throwing_allocator(); + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp index d7df936f9413d..4c41ca54aafdd 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp @@ -19,7 +19,7 @@ #include "test_macros.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { std::deque d = {3, 4, 5, 6}; assert(d.size() == 4); @@ -38,6 +38,14 @@ int main(int, char**) { assert(d[3] == 6); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d)); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp index f5f1a23243002..3dd1d0c4dfc6a 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp @@ -20,7 +20,7 @@ #include "test_allocator.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { std::deque> d({3, 4, 5, 6}, test_allocator(3)); assert(d.get_allocator() == test_allocator(3)); @@ -41,6 +41,14 @@ int main(int, char**) { assert(d[3] == 6); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d)); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp index 1f8a044d0b602..379c8a88b1d7d 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp @@ -105,6 +105,9 @@ void test_emplacable_concept() { int main(int, char**) { basic_test(); test_emplacable_concept(); - +#if TEST_STD_VER >= 26 + static_assert(basic_test()); + static_assert(test_emplacable_concept()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp index 61318c3d0f2d3..ec95a9ff7e6d1 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp @@ -101,6 +101,10 @@ void test_emplacable_concept() { int main(int, char**) { basic_test(); test_emplacable_concept(); +#if TEST_STD_VER >= 26 + static_assert(basic_test()); + static_assert(test_emplacable_concept()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/move.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/move.pass.cpp index 66ff168cc83b7..ce4f6f5cd8eb6 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/move.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/move.pass.cpp @@ -21,7 +21,7 @@ #include "test_allocator.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; int* an = ab + sizeof(ab) / sizeof(ab[0]); @@ -79,6 +79,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2)); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c3)); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp index 985d8ad9db67f..5940e05c56fd6 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp @@ -21,7 +21,7 @@ #include "test_allocator.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; const int* an = ab + sizeof(ab) / sizeof(ab[0]); @@ -94,6 +94,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2)); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c3)); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp index 426dea0347101..06a6ae95e1b3c 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp @@ -21,7 +21,7 @@ #include "test_allocator.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; int* an = ab + sizeof(ab) / sizeof(ab[0]); @@ -98,6 +98,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2)); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c3)); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp index 37e8a801e9d71..0b817ca34011c 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp @@ -29,7 +29,7 @@ struct some_alloc { void allocate(std::size_t); }; -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { #if defined(_LIBCPP_VERSION) { typedef std::deque C; @@ -48,6 +48,14 @@ int main(int, char**) { static_assert(!std::is_nothrow_move_constructible::value, ""); } #endif // _LIBCPP_VERSION + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/op_equal.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/op_equal.pass.cpp index 05d172268e0bd..1905db90c4156 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/op_equal.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/op_equal.pass.cpp @@ -26,7 +26,7 @@ void test(const C& x) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(x)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; int* an = ab + sizeof(ab) / sizeof(ab[0]); @@ -66,6 +66,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(l2)); } #endif + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp index b2760b4a3ff49..0a1743ff7c678 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp @@ -19,7 +19,7 @@ #include "test_macros.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { std::deque d; d = {3, 4, 5, 6}; @@ -40,6 +40,14 @@ int main(int, char**) { assert(d[3] == 6); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d)); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/size.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/size.pass.cpp index f8f42bd668f83..542288aefc3d0 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/size.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/size.pass.cpp @@ -82,7 +82,7 @@ void test(unsigned n) { test2(n); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { test >(0); test >(1); test >(10); @@ -107,6 +107,14 @@ int main(int, char**) { test3>(1); test3>(3); #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp index 231aa9c44c663..caeea946d0461 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp @@ -31,7 +31,7 @@ void test(unsigned n, const T& x) { assert(*i == x); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { test >(0, 5); test >(1, 10); test >(10, 11); @@ -48,6 +48,14 @@ int main(int, char**) { #if TEST_STD_VER >= 11 test >(4095, 90); #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp index f8ea37e64d9eb..4fd29052d59f1 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp @@ -31,7 +31,7 @@ void test(unsigned n, const T& x, const Allocator& a) { assert(*i == x); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { std::allocator a; test(0, 5, a); @@ -64,6 +64,14 @@ int main(int, char**) { test(4097, 157, a); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp index 947e06bd64375..583a229775d02 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp @@ -66,7 +66,7 @@ void test() { test0(S({1, 2, 1}), opt(3), S({1, 2, 1}), 0); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { test>(); test>>(); test>>(); @@ -74,6 +74,14 @@ int main(int, char**) { test>(); test>(); + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp index ed5220422dab2..365bd1e88a881 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp @@ -68,7 +68,7 @@ void test() { test0(S({1, 2, 3}), False, S({1, 2, 3}), 0); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { test>(); test>>(); test>>(); @@ -76,6 +76,14 @@ int main(int, char**) { test>(); test>(); + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/append_range.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/append_range.pass.cpp index 56a1d226db46f..c03212a12c011 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/append_range.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/append_range.pass.cpp @@ -22,7 +22,8 @@ // {empty/one-element/full} container); // - appending move-only elements; // - an exception is thrown when copying the elements or when allocating new elements. -int main(int, char**) { + +TEST_CONSTEXPR_CXX26 bool test() { static_assert(test_constraints_append_range()); for_all_iterators_and_allocators([]() { @@ -34,6 +35,14 @@ int main(int, char**) { test_append_range_exception_safety_throwing_copy(); test_append_range_exception_safety_throwing_allocator(); + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/assign_range.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/assign_range.pass.cpp index 744e03a7b983e..556532a3919ae 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/assign_range.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/assign_range.pass.cpp @@ -21,7 +21,8 @@ // {empty/one-element/full} container); // - assigning move-only elements; // - an exception is thrown when copying the elements or when allocating new elements. -int main(int, char**) { + +TEST_CONSTEXPR_CXX26 bool test() { static_assert(test_constraints_assign_range()); for_all_iterators_and_allocators([]() { @@ -33,6 +34,14 @@ int main(int, char**) { test_assign_range_exception_safety_throwing_copy(); test_assign_range_exception_safety_throwing_allocator(); + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/clear.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/clear.pass.cpp index bb2fa6e52af43..cb422c90c8e29 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/clear.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/clear.pass.cpp @@ -18,7 +18,7 @@ #include "../../../NotConstructible.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { typedef NotConstructible T; typedef std::deque C; @@ -69,6 +69,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } #endif + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp index 7c90216a9ce56..1667d6a80aa72 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp @@ -74,7 +74,7 @@ void testN(int start, int N) { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -96,6 +96,14 @@ int main(int, char**) { for (int j = 0; j < N; ++j) testN> >(rng[i], rng[j]); } + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp index 590ab432dd519..f10363846fbbc 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp @@ -68,7 +68,7 @@ void testN(int start, int N) { test(c1); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -98,6 +98,14 @@ int main(int, char**) { assert(c.size() == 4); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp index 3fbaee1fc1587..d77535e83a635 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp @@ -68,7 +68,7 @@ void testN(int start, int N) { test(c1); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -98,6 +98,14 @@ int main(int, char**) { assert(c.size() == 4); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.invalidation.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.invalidation.pass.cpp index b538b0f037ab1..3de0d555f6642 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.invalidation.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.invalidation.pass.cpp @@ -56,7 +56,7 @@ void del_at_end(C c) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { std::deque queue; for (int i = 0; i < 20; ++i) queue.push_back(i); @@ -66,6 +66,14 @@ int main(int, char**) { del_at_end(queue); queue.pop_back(); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp index 2d40f0c449f4d..3833a79443596 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp @@ -93,7 +93,7 @@ void testN(int start, int N) { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -126,6 +126,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(v)); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp index 320d4771a2fc7..25b194bccf7fe 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp @@ -60,7 +60,7 @@ void del_at_end(C c, std::size_t num) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { std::deque queue; for (int i = 0; i < 20; ++i) queue.push_back(i); @@ -72,6 +72,14 @@ int main(int, char**) { } queue.pop_back(); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp index 1eaa7a6c72a57..3e757935b31af 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp @@ -99,7 +99,7 @@ void testN(int start, int N) { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -132,6 +132,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(v)); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp index 117ce63b93d7e..5af86445069b9 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp @@ -19,7 +19,7 @@ #include "test_macros.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { std::deque d(10, 1); std::deque::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6}); @@ -62,6 +62,14 @@ int main(int, char**) { assert(d[13] == 1); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d)); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp index 3941c1e8bc6c5..7da62fe7082de 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp @@ -235,7 +235,7 @@ void test_move() { #endif } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -270,6 +270,14 @@ int main(int, char**) { test_move > >(); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_range.pass.cpp index 7681eb63b9076..b818ab5b7a91c 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_range.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_range.pass.cpp @@ -26,7 +26,7 @@ // {empty/one-element/full} container at the {beginning/middle/end}); // - inserting move-only elements; // - an exception is thrown when copying the elements or when allocating new elements. -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { static_assert(test_constraints_insert_range()); for_all_iterators_and_allocators([]() { @@ -38,6 +38,14 @@ int main(int, char**) { test_insert_range_exception_safety_throwing_copy(); test_insert_range_exception_safety_throwing_allocator(); + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp index ff4654cf0ccb3..8ab016ef2a6c1 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp @@ -80,7 +80,7 @@ void testN(int start, int N) { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -102,6 +102,14 @@ int main(int, char**) { for (int j = 0; j < N; ++j) testN> >(rng[i], rng[j]); } + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp index 05a16a9e76387..62df9952e1b4e 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp @@ -113,7 +113,7 @@ void self_reference_test() { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -143,6 +143,14 @@ int main(int, char**) { self_reference_test> >(); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp index b9440acb4986a..e13944e458862 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp @@ -99,7 +99,7 @@ void self_reference_test() { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -126,6 +126,14 @@ int main(int, char**) { self_reference_test> >(); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_back.invalidation.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_back.invalidation.pass.cpp index 3d0133e362b6a..baa9202524d70 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_back.invalidation.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_back.invalidation.pass.cpp @@ -37,7 +37,7 @@ void test(C c) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { std::deque queue; for (int i = 0; i < 4098; ++i) queue.push_back(i); @@ -47,6 +47,14 @@ int main(int, char**) { queue.pop_back(); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(queue)); } + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp index 301d8e3342bb6..bb51057837cb4 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp @@ -58,7 +58,7 @@ void testN(int start, int N) { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -82,6 +82,14 @@ int main(int, char**) { testN> >(rng[i], rng[j]); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_front.invalidation.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_front.invalidation.pass.cpp index c857c3038d49e..35518330040cb 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_front.invalidation.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_front.invalidation.pass.cpp @@ -36,7 +36,7 @@ void test(C c) { assert(&*it2 == &*it4); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { std::deque queue; for (int i = 0; i < 4098; ++i) queue.push_back(i); @@ -46,6 +46,14 @@ int main(int, char**) { queue.pop_back(); LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(queue)); } + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp index 2bd390ac315e0..54226d4c7f331 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp @@ -58,7 +58,7 @@ void testN(int start, int N) { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -75,6 +75,14 @@ int main(int, char**) { testN> >(rng[i], rng[j]); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/prepend_range.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/prepend_range.pass.cpp index 3154cd389d2f0..ae62d60ebe6b4 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/prepend_range.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/prepend_range.pass.cpp @@ -22,7 +22,7 @@ // {empty/one-element/full} container); // - prepending move-only elements; // - an exception is thrown when copying the elements or when allocating new elements. -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { static_assert(test_constraints_prepend_range()); for_all_iterators_and_allocators([]() { @@ -34,6 +34,14 @@ int main(int, char**) { test_prepend_range_exception_safety_throwing_copy(); test_prepend_range_exception_safety_throwing_allocator(); + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back.pass.cpp index fff3433ab4dd4..b63f802ee02ad 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back.pass.cpp @@ -51,7 +51,7 @@ void test(int size) { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -66,6 +66,14 @@ int main(int, char**) { test> >(rng[j]); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp index 10da5b02f96f1..68e4be4387fb4 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp @@ -68,7 +68,7 @@ CMyClass::~CMyClass() { bool operator==(const CMyClass& lhs, const CMyClass& rhs) { return lhs.equal(rhs); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { CMyClass instance(42); { std::deque vec; @@ -100,6 +100,14 @@ int main(int, char**) { assert(vec == vec2); } } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp index c9e0ca7a6d7e0..1e12650d6234b 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp @@ -54,7 +54,7 @@ void test(int size) { } } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -73,6 +73,14 @@ int main(int, char**) { for (int j = 0; j < N; ++j) test> >(rng[j]); } + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp index 1fb8341895a35..50ac046e14453 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp @@ -58,7 +58,7 @@ void testN(int start, int N) { test(c1, -10); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -82,6 +82,14 @@ int main(int, char**) { testN> >(rng[i], rng[j]); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp index f4b77bcf09f62..76ad9367cce25 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp @@ -68,7 +68,7 @@ CMyClass::~CMyClass() { bool operator==(const CMyClass& lhs, const CMyClass& rhs) { return lhs.equal(rhs); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { CMyClass instance(42); { std::deque vec; @@ -100,6 +100,14 @@ int main(int, char**) { assert(vec == vec2); } } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp index 418a0c976e66c..24e2bcb5f1c3a 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp @@ -61,7 +61,7 @@ void testN(int start, int N) { test(c1, -10); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -76,6 +76,14 @@ int main(int, char**) { for (int j = 0; j < N; ++j) testN> >(rng[i], rng[j]); } + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.special/copy.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.special/copy.pass.cpp index 382d6e530b24f..dc926670de6f7 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.special/copy.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.special/copy.pass.cpp @@ -76,7 +76,7 @@ void testN(int start, int N) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -93,6 +93,14 @@ int main(int, char**) { testN> >(rng[i], rng[j]); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.special/copy_backward.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.special/copy_backward.pass.cpp index 1414f03a549c1..cc6f6a77e8ed6 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.special/copy_backward.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.special/copy_backward.pass.cpp @@ -75,7 +75,7 @@ void testN(int start, int N) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -92,6 +92,14 @@ int main(int, char**) { testN> >(rng[i], rng[j]); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.special/move.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.special/move.pass.cpp index 4b24141db3cee..de4c65c7eba0e 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.special/move.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.special/move.pass.cpp @@ -75,7 +75,7 @@ void testN(int start, int N) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -92,6 +92,14 @@ int main(int, char**) { testN> >(rng[i], rng[j]); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.special/move_backward.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.special/move_backward.pass.cpp index 726abe7617aef..523a479eef005 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.special/move_backward.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.special/move_backward.pass.cpp @@ -75,7 +75,7 @@ void testN(int start, int N) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -92,6 +92,14 @@ int main(int, char**) { testN > >(rng[i], rng[j]); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.special/swap.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.special/swap.pass.cpp index 07004315a0bfb..13a1b8735e0d8 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.special/swap.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.special/swap.pass.cpp @@ -52,7 +52,7 @@ void testN(int start, int N, int M) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2_save)); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng) / sizeof(rng[0]); @@ -113,6 +113,14 @@ int main(int, char**) { LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2)); } #endif + return true; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp index 6347496d67c15..97c61322f4e73 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp @@ -52,7 +52,7 @@ struct some_alloc2 { typedef std::true_type is_always_equal; }; -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { typedef std::deque C; static_assert(noexcept(swap(std::declval(), std::declval())), ""); @@ -83,6 +83,14 @@ int main(int, char**) { static_assert(noexcept(swap(std::declval(), std::declval())), ""); } #endif + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/get_allocator.pass.cpp b/libcxx/test/std/containers/sequences/deque/get_allocator.pass.cpp index 6b8bc6c555bcd..38cb73cfe5e28 100644 --- a/libcxx/test/std/containers/sequences/deque/get_allocator.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/get_allocator.pass.cpp @@ -18,7 +18,7 @@ #include "test_allocator.h" #include "test_macros.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { std::allocator alloc; const std::deque d(alloc); @@ -29,6 +29,14 @@ int main(int, char**) { const std::deque > d(alloc); assert(d.get_allocator() == alloc); } + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/iterators.pass.cpp b/libcxx/test/std/containers/sequences/deque/iterators.pass.cpp index 337fd688ebcdb..604a5a79d9671 100644 --- a/libcxx/test/std/containers/sequences/deque/iterators.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/iterators.pass.cpp @@ -22,7 +22,7 @@ #include "test_macros.h" #include "min_allocator.h" -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool test() { { typedef std::deque C; C c; @@ -104,6 +104,13 @@ int main(int, char**) { # endif // TEST_STD_VER > 20 } #endif + return true; +} +int main(int, char**) { + test(); +#if TEST_STD_VER >= 26 + static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/containers/sequences/deque/types.pass.cpp b/libcxx/test/std/containers/sequences/deque/types.pass.cpp index 8184d55873d20..da12694aa14c0 100644 --- a/libcxx/test/std/containers/sequences/deque/types.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/types.pass.cpp @@ -77,7 +77,7 @@ void test() { ""); } -int main(int, char**) { +TEST_CONSTEXPR_CXX26 bool tests() { test >(); test >(); test >(); @@ -106,6 +106,14 @@ int main(int, char**) { ""); } #endif + return false; +} + +int main(int, char**) { + tests(); +#if TEST_STD_VER >= 26 + static_assert(tests()); +#endif return 0; } diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp index d0e4ac130c60e..1cc6fbcf49944 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp @@ -17,6 +17,7 @@ /* Constant Value __cpp_lib_allocator_traits_is_always_equal 201411L [C++17] + __cpp_lib_constexpr_deque 202502L [C++26] __cpp_lib_containers_ranges 202202L [C++23] __cpp_lib_default_template_type_for_algorithm_values 202403L [C++26] __cpp_lib_erase_if 202002L [C++20] @@ -32,6 +33,10 @@ # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifdef __cpp_lib_containers_ranges # error "__cpp_lib_containers_ranges should not be defined before c++23" # endif @@ -54,6 +59,10 @@ # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifdef __cpp_lib_containers_ranges # error "__cpp_lib_containers_ranges should not be defined before c++23" # endif @@ -79,6 +88,10 @@ # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifdef __cpp_lib_containers_ranges # error "__cpp_lib_containers_ranges should not be defined before c++23" # endif @@ -107,6 +120,10 @@ # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifdef __cpp_lib_containers_ranges # error "__cpp_lib_containers_ranges should not be defined before c++23" # endif @@ -138,6 +155,10 @@ # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifndef __cpp_lib_containers_ranges # error "__cpp_lib_containers_ranges should be defined in c++23" # endif @@ -172,6 +193,13 @@ # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" # endif +# ifndef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should be defined in c++26" +# endif +# if __cpp_lib_constexpr_deque != 202502L +# error "__cpp_lib_constexpr_deque should have the value 202502L in c++26" +# endif + # ifndef __cpp_lib_containers_ranges # error "__cpp_lib_containers_ranges should be defined in c++26" # endif diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp index 9b318f2deabc4..6e262e83a1423 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp @@ -61,6 +61,7 @@ __cpp_lib_constexpr_charconv 202207L [C++23] __cpp_lib_constexpr_cmath 202202L [C++23] __cpp_lib_constexpr_complex 201711L [C++20] + __cpp_lib_constexpr_deque 202502L [C++26] __cpp_lib_constexpr_dynamic_alloc 201907L [C++20] __cpp_lib_constexpr_functional 201907L [C++20] __cpp_lib_constexpr_iterator 201811L [C++20] @@ -427,6 +428,10 @@ # error "__cpp_lib_constexpr_complex should not be defined before c++20" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifdef __cpp_lib_constexpr_dynamic_alloc # error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20" # endif @@ -1303,6 +1308,10 @@ # error "__cpp_lib_constexpr_complex should not be defined before c++20" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifdef __cpp_lib_constexpr_dynamic_alloc # error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20" # endif @@ -2281,6 +2290,10 @@ # error "__cpp_lib_constexpr_complex should not be defined before c++20" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifdef __cpp_lib_constexpr_dynamic_alloc # error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20" # endif @@ -3496,6 +3509,10 @@ # error "__cpp_lib_constexpr_complex should have the value 201711L in c++20" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifndef __cpp_lib_constexpr_dynamic_alloc # error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++20" # endif @@ -4936,6 +4953,10 @@ # error "__cpp_lib_constexpr_complex should have the value 201711L in c++23" # endif +# ifdef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should not be defined before c++26" +# endif + # ifndef __cpp_lib_constexpr_dynamic_alloc # error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++23" # endif @@ -6592,6 +6613,13 @@ # error "__cpp_lib_constexpr_complex should have the value 201711L in c++26" # endif +# ifndef __cpp_lib_constexpr_deque +# error "__cpp_lib_constexpr_deque should be defined in c++26" +# endif +# if __cpp_lib_constexpr_deque != 202502L +# error "__cpp_lib_constexpr_deque should have the value 202502L in c++26" +# endif + # ifndef __cpp_lib_constexpr_dynamic_alloc # error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++26" # endif diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py index 6a9c7b4ea586c..e9e62369474d1 100755 --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -345,6 +345,11 @@ def add_version_header(tc): "values": {"c++20": 201711}, "headers": ["complex"], }, + { + "name": "__cpp_lib_constexpr_deque", + "values": {"c++26": 202502}, + "headers": ["deque"], + }, { "name": "__cpp_lib_constexpr_dynamic_alloc", "values": {"c++20": 201907},