[libcxx-commits] [libcxx] [libc++] constexpr deque (PR #129368)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 18 01:56:42 PDT 2026
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/129368
>From 171cd5aedbd28a58568ed2735a88d6bdc8a04ea4 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sat, 1 Mar 2025 01:59:41 -0500
Subject: [PATCH 01/41] constexpr deque
---
libcxx/include/deque | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 95200b4801d7f..c92b89aa9f1c0 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -2543,7 +2543,8 @@ inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI bool operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
+inline _LIBCPP_HIDE_FROM_ABI constexpr 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 +2579,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const deque<_Tp, _Allocator>& __x,
# else // _LIBCPP_STD_VER <= 17
template <class _Tp, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp> constexpr
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 +2587,14 @@ operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y
# endif // _LIBCPP_STD_VER <= 17
template <class _Tp, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
+inline _LIBCPP_HIDE_FROM_ABI constexpr void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
__x.swap(__y);
}
# if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type
+inline _LIBCPP_HIDE_FROM_ABI constexpr 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 +2602,7 @@ erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
}
template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type
+inline _LIBCPP_HIDE_FROM_ABI constexpr 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());
>From caf34bf171925980dce184270b4415d97e10d568 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sat, 1 Mar 2025 14:45:24 -0500
Subject: [PATCH 02/41] use new macros
---
libcxx/include/deque | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index c92b89aa9f1c0..beea24604d258 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -2543,7 +2543,7 @@ inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI constexpr bool
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr 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());
@@ -2579,7 +2579,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const deque<_Tp, _Allocator>& __x,
# else // _LIBCPP_STD_VER <= 17
template <class _Tp, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp> constexpr
+_LIBCPP_CONSTEXPR_SINCE_CXX26 __synth_three_way_result<_Tp> constexpr
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);
}
@@ -2587,14 +2587,14 @@ operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y
# endif // _LIBCPP_STD_VER <= 17
template <class _Tp, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI constexpr void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
__x.swap(__y);
}
# if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_HIDE_FROM_ABI constexpr typename deque<_Tp, _Allocator>::size_type
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr 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());
@@ -2602,7 +2602,7 @@ erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
}
template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI constexpr typename deque<_Tp, _Allocator>::size_type
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr 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());
>From 7e8a820d1f61012e089e9436d56582dd0b36e723 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sat, 1 Mar 2025 15:03:32 -0500
Subject: [PATCH 03/41] update test files to reflect constexpr
---
.../std/containers/sequences/deque/compare.pass.cpp | 10 +++++++++-
.../sequences/deque/compare.three_way.pass.cpp | 11 +++++++++--
.../sequences/deque/deque.capacity/access.pass.cpp | 10 +++++++++-
.../sequences/deque/deque.capacity/empty.pass.cpp | 9 ++++++++-
.../sequences/deque/deque.capacity/max_size.pass.cpp | 10 +++++++++-
.../deque/deque.capacity/resize_size.pass.cpp | 10 +++++++++-
.../deque/deque.capacity/resize_size_value.pass.cpp | 10 +++++++++-
.../deque/deque.capacity/shrink_to_fit.pass.cpp | 10 +++++++++-
.../sequences/deque/deque.capacity/size.pass.cpp | 10 +++++++++-
.../containers/sequences/deque/get_allocator.pass.cpp | 10 +++++++++-
.../std/containers/sequences/deque/iterators.pass.cpp | 9 ++++++++-
.../std/containers/sequences/deque/types.pass.cpp | 10 +++++++++-
12 files changed, 106 insertions(+), 13 deletions(-)
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<int> d1, d2;
assert(testComparisons(d1, d2, true, false));
@@ -113,6 +113,14 @@ int main(int, char**) {
const std::deque<LessAndEqComp> 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>());
- // `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<int> C;
C c = make<std::deque<int> >(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<int> 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<int, 10> A;
typedef std::deque<int, A> 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<std::deque<int, safe_allocator<int>>>(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<std::deque<int, safe_allocator<int>> >(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<int> 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/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<int> alloc;
const std::deque<int> d(alloc);
@@ -29,6 +29,14 @@ int main(int, char**) {
const std::deque<int, other_allocator<int> > 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<int> 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<int, test_allocator<int> >();
test<int*, std::allocator<int*> >();
test<Copyable, test_allocator<Copyable> >();
@@ -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;
}
>From 28f98a858b1e5a4e5243b108e8422278d938a9bb Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sat, 1 Mar 2025 15:17:17 -0500
Subject: [PATCH 04/41] more files updated
---
.../sequences/deque/deque.cons/alloc.pass.cpp | 28 ++++++++++++-------
.../assign_initializer_list.pass.cpp | 9 +++++-
.../deque.cons/assign_iter_iter.pass.cpp | 4 ++-
.../deque.cons/assign_size_value.pass.cpp | 10 ++++++-
.../sequences/deque/deque.cons/copy.pass.cpp | 10 ++++++-
.../deque/deque.cons/copy_alloc.pass.cpp | 10 ++++++-
.../deque/deque.cons/deduct.pass.cpp | 10 ++++++-
.../deque/deque.cons/default.pass.cpp | 10 ++++++-
.../deque.cons/default_noexcept.pass.cpp | 10 ++++++-
.../deque/deque.cons/dtor_noexcept.pass.cpp | 10 ++++++-
.../deque/deque.cons/from_range.pass.cpp | 10 ++++++-
.../deque.cons/initializer_list.pass.cpp | 10 ++++++-
.../initializer_list_alloc.pass.cpp | 10 ++++++-
.../deque/deque.cons/iter_iter.pass.cpp | 5 +++-
.../deque/deque.cons/iter_iter_alloc.pass.cpp | 4 +++
.../deque/deque.cons/move_alloc.pass.cpp | 10 ++++++-
16 files changed, 136 insertions(+), 24 deletions(-)
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 <class T, class Allocator>
-void test(const Allocator& a) {
+void test_util(const Allocator& a) {
std::deque<T, Allocator> 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<int>(std::allocator<int>());
- test<NotConstructible>(test_allocator<NotConstructible>(3));
+TEST_CONSTEXPR_CXX26 bool test() {
+ test_util<int>(std::allocator<int>());
+ test_util<NotConstructible>(test_allocator<NotConstructible>(3));
#if TEST_STD_VER >= 11
- test<int>(min_allocator<int>());
- test<int>(safe_allocator<int>());
- test<NotConstructible>(min_allocator<NotConstructible>{});
- test<NotConstructible>(safe_allocator<NotConstructible>{});
- test<int>(explicit_allocator<int>());
- test<NotConstructible>(explicit_allocator<NotConstructible>{});
+ test_util<int>(min_allocator<int>());
+ test_util<int>(safe_allocator<int>());
+ test_util<NotConstructible>(min_allocator<NotConstructible>{});
+ test_util<NotConstructible>(safe_allocator<NotConstructible>{});
+ test_util<int>(explicit_allocator<int>());
+ test_util<NotConstructible>(explicit_allocator<NotConstructible>{});
+#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<int> 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<std::deque<int, min_allocator<int>> >(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<int, safe_allocator<int> >(ab, an, safe_allocator<int>()), safe_allocator<int>());
}
#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<std::deque, std::deque<int>>();
+ 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<int, std::allocator<int> >();
test<NotConstructible, limited_allocator<NotConstructible, 1> >();
#if TEST_STD_VER >= 11
test<int, min_allocator<int> >();
test<NotConstructible, min_allocator<NotConstructible> >();
#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<MoveOnly> C;
@@ -48,6 +48,14 @@ int main(int, char**) {
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::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<MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
@@ -46,6 +46,14 @@ int main(int, char**) {
static_assert(!std::is_nothrow_destructible<C>::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<container-compatible-range<T> 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<int>([]<class Iter, class Sent, class Alloc>() {
test_sequence_container<std::deque, int, Iter, Sent, Alloc>([]([[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<std::deque>();
//test_exception_safety_throwing_allocator<std::deque, int>();
+ 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<int> 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<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
assert(d.get_allocator() == test_allocator<int>(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_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;
}
>From 00e3607e5fd649f813e30fe85332693eb07e6201 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sat, 1 Mar 2025 15:21:40 -0500
Subject: [PATCH 05/41] feature test macros
---
libcxx/docs/FeatureTestMacroTable.rst | 4 +-
libcxx/include/version | 6 ++-
.../complex.version.compile.pass.cpp | 42 +++++++--------
.../deque.version.compile.pass.cpp | 28 ++++++++++
.../version.version.compile.pass.cpp | 52 ++++++++++++++-----
.../generate_feature_test_macro_components.py | 7 ++-
6 files changed, 102 insertions(+), 37 deletions(-)
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index dcf9838edd74b..f53ac166cffce 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -202,7 +202,7 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_constexpr_algorithms`` ``201806L``
---------------------------------------------------------- -----------------
- ``__cpp_lib_constexpr_complex`` ``201711L``
+ ``__cpp_lib_constexpr_deque`` ``202502L``
---------------------------------------------------------- -----------------
``__cpp_lib_constexpr_dynamic_alloc`` ``201907L``
---------------------------------------------------------- -----------------
@@ -416,6 +416,8 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_bitset`` ``202306L``
---------------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_complex`` ``201711L``
+ ---------------------------------------------------------- -----------------
``__cpp_lib_constexpr_new`` ``202406L``
---------------------------------------------------------- -----------------
``__cpp_lib_constrained_equality`` *unimplemented*
diff --git a/libcxx/include/version b/libcxx/include/version
index 63ead9fd5d29d..c783da85fb7ea 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -64,7 +64,8 @@ __cpp_lib_constexpr_algorithms 201806L <algorithm> <uti
__cpp_lib_constexpr_bitset 202207L <bitset>
__cpp_lib_constexpr_charconv 202207L <charconv>
__cpp_lib_constexpr_cmath 202202L <cmath> <cstdlib>
-__cpp_lib_constexpr_complex 201711L <complex>
+__cpp_lib_constexpr_complex 201711L <deque>
+__cpp_lib_constexpr_deque 202502L <complex>
__cpp_lib_constexpr_dynamic_alloc 201907L <memory>
__cpp_lib_constexpr_functional 201907L <functional>
__cpp_lib_constexpr_iterator 201811L <iterator>
@@ -398,7 +399,7 @@ __cpp_lib_void_t 201411L <type_traits>
# endif
# define __cpp_lib_concepts 202002L
# define __cpp_lib_constexpr_algorithms 201806L
-# define __cpp_lib_constexpr_complex 201711L
+# define __cpp_lib_constexpr_deque 202502L
# define __cpp_lib_constexpr_dynamic_alloc 201907L
# define __cpp_lib_constexpr_functional 201907L
# define __cpp_lib_constexpr_iterator 201811L
@@ -536,6 +537,7 @@ __cpp_lib_void_t 201411L <type_traits>
# undef __cpp_lib_bind_front
# define __cpp_lib_bind_front 202306L
# define __cpp_lib_bitset 202306L
+# define __cpp_lib_constexpr_complex 201711L
# if !defined(_LIBCPP_ABI_VCRUNTIME)
# define __cpp_lib_constexpr_new 202406L
# endif
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
index 3718a9e222f98..6fd155f7b4216 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
@@ -15,9 +15,9 @@
// Test the feature test macros defined by <complex>
-/* Constant Value
- __cpp_lib_complex_udls 201309L [C++14]
- __cpp_lib_constexpr_complex 201711L [C++20]
+/* Constant Value
+ __cpp_lib_complex_udls 201309L [C++14]
+ __cpp_lib_constexpr_deque 202502L [C++20]
*/
#include <complex>
@@ -29,8 +29,8 @@
# error "__cpp_lib_complex_udls should not be defined before c++14"
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++20"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++20"
# endif
#elif TEST_STD_VER == 14
@@ -42,8 +42,8 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++14"
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++20"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++20"
# endif
#elif TEST_STD_VER == 17
@@ -55,8 +55,8 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++17"
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++20"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++20"
# endif
#elif TEST_STD_VER == 20
@@ -68,11 +68,11 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++20"
# endif
-# ifndef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should be defined in c++20"
+# ifndef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should be defined in c++20"
# endif
-# if __cpp_lib_constexpr_complex != 201711L
-# error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
+# if __cpp_lib_constexpr_deque != 202502L
+# error "__cpp_lib_constexpr_deque should have the value 202502L in c++20"
# endif
#elif TEST_STD_VER == 23
@@ -84,11 +84,11 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++23"
# endif
-# ifndef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should be defined in c++23"
+# ifndef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should be defined in c++23"
# endif
-# if __cpp_lib_constexpr_complex != 201711L
-# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
+# if __cpp_lib_constexpr_deque != 202502L
+# error "__cpp_lib_constexpr_deque should have the value 202502L in c++23"
# endif
#elif TEST_STD_VER > 23
@@ -100,11 +100,11 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++26"
# endif
-# ifndef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should be defined in c++26"
+# ifndef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should be defined in c++26"
# endif
-# if __cpp_lib_constexpr_complex != 201711L
-# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
+# if __cpp_lib_constexpr_deque != 202502L
+# error "__cpp_lib_constexpr_deque should have the value 202502L in c++26"
# endif
#endif // TEST_STD_VER > 23
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..6f716eeefdeef 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_complex 201711L [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_complex
+# error "__cpp_lib_constexpr_complex 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_complex
+# error "__cpp_lib_constexpr_complex 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_complex
+# error "__cpp_lib_constexpr_complex 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_complex
+# error "__cpp_lib_constexpr_complex 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_complex
+# error "__cpp_lib_constexpr_complex 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_complex
+# error "__cpp_lib_constexpr_complex should be defined in c++26"
+# endif
+# if __cpp_lib_constexpr_complex != 201711L
+# error "__cpp_lib_constexpr_complex should have the value 201711L 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 1e4465d515e6b..8214c757f0576 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
@@ -59,7 +59,8 @@
__cpp_lib_constexpr_bitset 202207L [C++23]
__cpp_lib_constexpr_charconv 202207L [C++23]
__cpp_lib_constexpr_cmath 202202L [C++23]
- __cpp_lib_constexpr_complex 201711L [C++20]
+ __cpp_lib_constexpr_complex 201711L [C++26]
+ __cpp_lib_constexpr_deque 202502L [C++20]
__cpp_lib_constexpr_dynamic_alloc 201907L [C++20]
__cpp_lib_constexpr_functional 201907L [C++20]
__cpp_lib_constexpr_iterator 201811L [C++20]
@@ -423,7 +424,11 @@
# endif
# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++20"
+# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# endif
+
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++20"
# endif
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -1299,7 +1304,11 @@
# endif
# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++20"
+# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# endif
+
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++20"
# endif
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -2277,7 +2286,11 @@
# endif
# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++20"
+# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# endif
+
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++20"
# endif
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -3488,11 +3501,15 @@
# error "__cpp_lib_constexpr_cmath should not be defined before c++23"
# endif
-# ifndef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should be defined in c++20"
+# ifdef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should not be defined before c++26"
# endif
-# if __cpp_lib_constexpr_complex != 201711L
-# error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
+
+# ifndef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should be defined in c++20"
+# endif
+# if __cpp_lib_constexpr_deque != 202502L
+# error "__cpp_lib_constexpr_deque should have the value 202502L in c++20"
# endif
# ifndef __cpp_lib_constexpr_dynamic_alloc
@@ -4928,11 +4945,15 @@
# endif
# endif
-# ifndef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should be defined in c++23"
+# ifdef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should not be defined before c++26"
# endif
-# if __cpp_lib_constexpr_complex != 201711L
-# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
+
+# ifndef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should be defined in c++23"
+# endif
+# if __cpp_lib_constexpr_deque != 202502L
+# error "__cpp_lib_constexpr_deque should have the value 202502L in c++23"
# endif
# ifndef __cpp_lib_constexpr_dynamic_alloc
@@ -6603,6 +6624,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 8bf7633e985d5..41627efa51ad5 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -342,7 +342,12 @@ def add_version_header(tc):
},
{
"name": "__cpp_lib_constexpr_complex",
- "values": {"c++20": 201711},
+ "values": {"c++26": 201711},
+ "headers": ["deque"],
+ },
+ {
+ "name": "__cpp_lib_constexpr_deque",
+ "values": {"c++20": 202502},
"headers": ["complex"],
},
{
>From 82e293bc5efe3b9e73a1f8506c6e2c9fab291a83 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sun, 2 Mar 2025 12:52:48 -0500
Subject: [PATCH 06/41] fix FTM and constexpr macro
---
libcxx/docs/FeatureTestMacroTable.rst | 4 +-
libcxx/include/deque | 10 ++---
libcxx/include/version | 8 ++--
.../complex.version.compile.pass.cpp | 42 +++++++++---------
.../deque.version.compile.pass.cpp | 30 ++++++-------
.../version.version.compile.pass.cpp | 44 +++++++++----------
.../generate_feature_test_macro_components.py | 8 ++--
7 files changed, 73 insertions(+), 73 deletions(-)
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index f53ac166cffce..07e76c900ca63 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -202,7 +202,7 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_constexpr_algorithms`` ``201806L``
---------------------------------------------------------- -----------------
- ``__cpp_lib_constexpr_deque`` ``202502L``
+ ``__cpp_lib_constexpr_complex`` ``201711L``
---------------------------------------------------------- -----------------
``__cpp_lib_constexpr_dynamic_alloc`` ``201907L``
---------------------------------------------------------- -----------------
@@ -416,7 +416,7 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_bitset`` ``202306L``
---------------------------------------------------------- -----------------
- ``__cpp_lib_constexpr_complex`` ``201711L``
+ ``__cpp_lib_constexpr_deque`` ``202502L``
---------------------------------------------------------- -----------------
``__cpp_lib_constexpr_new`` ``202406L``
---------------------------------------------------------- -----------------
diff --git a/libcxx/include/deque b/libcxx/include/deque
index beea24604d258..e277455dd785a 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -2543,7 +2543,7 @@ inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr bool
+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());
@@ -2579,7 +2579,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const deque<_Tp, _Allocator>& __x,
# else // _LIBCPP_STD_VER <= 17
template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX26 __synth_three_way_result<_Tp> constexpr
+_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);
}
@@ -2587,14 +2587,14 @@ operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y
# endif // _LIBCPP_STD_VER <= 17
template <class _Tp, class _Allocator>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __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 <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr 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());
@@ -2602,7 +2602,7 @@ erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
}
template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr 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 c783da85fb7ea..7bc75706cf9f6 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -64,8 +64,8 @@ __cpp_lib_constexpr_algorithms 201806L <algorithm> <uti
__cpp_lib_constexpr_bitset 202207L <bitset>
__cpp_lib_constexpr_charconv 202207L <charconv>
__cpp_lib_constexpr_cmath 202202L <cmath> <cstdlib>
-__cpp_lib_constexpr_complex 201711L <deque>
-__cpp_lib_constexpr_deque 202502L <complex>
+__cpp_lib_constexpr_complex 201711L <complex>
+__cpp_lib_constexpr_deque 202502L <deque>
__cpp_lib_constexpr_dynamic_alloc 201907L <memory>
__cpp_lib_constexpr_functional 201907L <functional>
__cpp_lib_constexpr_iterator 201811L <iterator>
@@ -399,7 +399,7 @@ __cpp_lib_void_t 201411L <type_traits>
# endif
# define __cpp_lib_concepts 202002L
# define __cpp_lib_constexpr_algorithms 201806L
-# define __cpp_lib_constexpr_deque 202502L
+# define __cpp_lib_constexpr_complex 201711L
# define __cpp_lib_constexpr_dynamic_alloc 201907L
# define __cpp_lib_constexpr_functional 201907L
# define __cpp_lib_constexpr_iterator 201811L
@@ -537,7 +537,7 @@ __cpp_lib_void_t 201411L <type_traits>
# undef __cpp_lib_bind_front
# define __cpp_lib_bind_front 202306L
# define __cpp_lib_bitset 202306L
-# define __cpp_lib_constexpr_complex 201711L
+# define __cpp_lib_constexpr_deque 202502L
# if !defined(_LIBCPP_ABI_VCRUNTIME)
# define __cpp_lib_constexpr_new 202406L
# endif
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
index 6fd155f7b4216..3718a9e222f98 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
@@ -15,9 +15,9 @@
// Test the feature test macros defined by <complex>
-/* Constant Value
- __cpp_lib_complex_udls 201309L [C++14]
- __cpp_lib_constexpr_deque 202502L [C++20]
+/* Constant Value
+ __cpp_lib_complex_udls 201309L [C++14]
+ __cpp_lib_constexpr_complex 201711L [C++20]
*/
#include <complex>
@@ -29,8 +29,8 @@
# error "__cpp_lib_complex_udls should not be defined before c++14"
# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++20"
+# ifdef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should not be defined before c++20"
# endif
#elif TEST_STD_VER == 14
@@ -42,8 +42,8 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++14"
# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++20"
+# ifdef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should not be defined before c++20"
# endif
#elif TEST_STD_VER == 17
@@ -55,8 +55,8 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++17"
# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++20"
+# ifdef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should not be defined before c++20"
# endif
#elif TEST_STD_VER == 20
@@ -68,11 +68,11 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++20"
# endif
-# ifndef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should be defined in c++20"
+# ifndef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should be defined in c++20"
# endif
-# if __cpp_lib_constexpr_deque != 202502L
-# error "__cpp_lib_constexpr_deque should have the value 202502L in c++20"
+# if __cpp_lib_constexpr_complex != 201711L
+# error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
# endif
#elif TEST_STD_VER == 23
@@ -84,11 +84,11 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++23"
# endif
-# ifndef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should be defined in c++23"
+# ifndef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should be defined in c++23"
# endif
-# if __cpp_lib_constexpr_deque != 202502L
-# error "__cpp_lib_constexpr_deque should have the value 202502L in c++23"
+# if __cpp_lib_constexpr_complex != 201711L
+# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
# endif
#elif TEST_STD_VER > 23
@@ -100,11 +100,11 @@
# error "__cpp_lib_complex_udls should have the value 201309L in c++26"
# endif
-# ifndef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should be defined in c++26"
+# ifndef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex 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"
+# if __cpp_lib_constexpr_complex != 201711L
+# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
# endif
#endif // TEST_STD_VER > 23
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 6f716eeefdeef..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,7 +17,7 @@
/* Constant Value
__cpp_lib_allocator_traits_is_always_equal 201411L [C++17]
- __cpp_lib_constexpr_complex 201711L [C++26]
+ __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]
@@ -33,8 +33,8 @@
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_containers_ranges
@@ -59,8 +59,8 @@
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_containers_ranges
@@ -88,8 +88,8 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_containers_ranges
@@ -120,8 +120,8 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_containers_ranges
@@ -155,8 +155,8 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifndef __cpp_lib_containers_ranges
@@ -193,11 +193,11 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
# endif
-# ifndef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should be defined in c++26"
+# ifndef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should be defined in c++26"
# endif
-# if __cpp_lib_constexpr_complex != 201711L
-# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
+# 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
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 8214c757f0576..27f901998b0de 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
@@ -59,8 +59,8 @@
__cpp_lib_constexpr_bitset 202207L [C++23]
__cpp_lib_constexpr_charconv 202207L [C++23]
__cpp_lib_constexpr_cmath 202202L [C++23]
- __cpp_lib_constexpr_complex 201711L [C++26]
- __cpp_lib_constexpr_deque 202502L [C++20]
+ __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]
@@ -424,11 +424,11 @@
# endif
# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# 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++20"
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -1304,11 +1304,11 @@
# endif
# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# 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++20"
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -2286,11 +2286,11 @@
# endif
# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# 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++20"
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -3501,15 +3501,15 @@
# error "__cpp_lib_constexpr_cmath should not be defined before c++23"
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# ifndef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should be defined in c++20"
# endif
-
-# ifndef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should be defined in c++20"
+# if __cpp_lib_constexpr_complex != 201711L
+# error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
# endif
-# if __cpp_lib_constexpr_deque != 202502L
-# error "__cpp_lib_constexpr_deque should have the value 202502L in c++20"
+
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifndef __cpp_lib_constexpr_dynamic_alloc
@@ -4945,15 +4945,15 @@
# endif
# endif
-# ifdef __cpp_lib_constexpr_complex
-# error "__cpp_lib_constexpr_complex should not be defined before c++26"
+# ifndef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should be defined in c++23"
# endif
-
-# ifndef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should be defined in c++23"
+# if __cpp_lib_constexpr_complex != 201711L
+# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
# endif
-# if __cpp_lib_constexpr_deque != 202502L
-# error "__cpp_lib_constexpr_deque should have the value 202502L in c++23"
+
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifndef __cpp_lib_constexpr_dynamic_alloc
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 41627efa51ad5..985c81c56f0d1 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -342,13 +342,13 @@ def add_version_header(tc):
},
{
"name": "__cpp_lib_constexpr_complex",
- "values": {"c++26": 201711},
- "headers": ["deque"],
+ "values": {"c++20": 201711},
+ "headers": ["complex"],
},
{
"name": "__cpp_lib_constexpr_deque",
- "values": {"c++20": 202502},
- "headers": ["complex"],
+ "values": {"c++26": 202502},
+ "headers": ["deque"],
},
{
"name": "__cpp_lib_constexpr_dynamic_alloc",
>From 129f6d6066dedd413480f4403b0e75c35b06ea60 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sun, 2 Mar 2025 13:00:52 -0500
Subject: [PATCH 07/41] update more test files
---
.../sequences/deque/deque.cons/deduct.verify.cpp | 10 +++++++++-
.../sequences/deque/deque.cons/move.pass.cpp | 10 +++++++++-
.../sequences/deque/deque.cons/move_assign.pass.cpp | 12 ++++++++++--
.../deque/deque.cons/move_noexcept.pass.cpp | 12 ++++++++++--
.../sequences/deque/deque.cons/op_equal.pass.cpp | 12 ++++++++++--
.../deque.cons/op_equal_initializer_list.pass.cpp | 11 ++++++++++-
.../sequences/deque/deque.cons/size.pass.cpp | 10 +++++++++-
.../sequences/deque/deque.cons/size_value.pass.cpp | 13 +++++++++++--
.../deque/deque.cons/size_value_alloc.pass.cpp | 12 ++++++++++--
.../sequences/deque/deque.erasure/erase.pass.cpp | 10 +++++++++-
.../sequences/deque/deque.erasure/erase_if.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/append_range.pass.cpp | 11 ++++++++++-
12 files changed, 116 insertions(+), 17 deletions(-)
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<int>, allocator<allocator<int>>>
}
+ 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.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_assign.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
index 426dea0347101..87f6b5a35ad5e 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,8 +21,8 @@
#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]);
typedef test_allocator<MoveOnly> A;
@@ -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..194487e64c848 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,8 +29,8 @@ struct some_alloc {
void allocate(std::size_t);
};
-int main(int, char**) {
-#if defined(_LIBCPP_VERSION)
+TEST_CONSTEXPR_CXX26 bool test() {
+ #if defined(_LIBCPP_VERSION)
{
typedef std::deque<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
@@ -48,6 +48,14 @@ int main(int, char**) {
static_assert(!std::is_nothrow_move_constructible<C>::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..89f8b0a0a0f98 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,8 +26,8 @@ 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]);
test(std::deque<int>(ab, an));
@@ -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..5be8753ed08bb 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<int> d;
d = {3, 4, 5, 6};
@@ -40,6 +40,15 @@ 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<T, Allocator>(n);
}
-int main(int, char**) {
+TEST_CONSTEXPR_CXX26 bool tests() {
test<DefaultOnly, std::allocator<DefaultOnly> >(0);
test<DefaultOnly, std::allocator<DefaultOnly> >(1);
test<DefaultOnly, std::allocator<DefaultOnly> >(10);
@@ -107,6 +107,14 @@ int main(int, char**) {
test3<int, std::allocator<int>>(1);
test3<int, min_allocator<int>>(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..78590d7b87954 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,8 +31,8 @@ void test(unsigned n, const T& x) {
assert(*i == x);
}
-int main(int, char**) {
- test<int, std::allocator<int> >(0, 5);
+TEST_CONSTEXPR_CXX26 bool tests() {
+ test<int, std::allocator<int> >(0, 5);
test<int, std::allocator<int> >(1, 10);
test<int, std::allocator<int> >(10, 11);
test<int, std::allocator<int> >(1023, -11);
@@ -48,6 +48,15 @@ int main(int, char**) {
#if TEST_STD_VER >= 11
test<int, min_allocator<int> >(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..d9c9cb8b41c6e 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,8 +31,8 @@ void test(unsigned n, const T& x, const Allocator& a) {
assert(*i == x);
}
-int main(int, char**) {
- {
+TEST_CONSTEXPR_CXX26 bool tests() {
+ {
std::allocator<int> a;
test(0, 5, a);
test(1, 10, 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<std::deque<int>>();
test<std::deque<int, min_allocator<int>>>();
test<std::deque<int, safe_allocator<int>>>();
@@ -74,6 +74,14 @@ int main(int, char**) {
test<std::deque<long>>();
test<std::deque<double>>();
+ 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<std::deque<int>>();
test<std::deque<int, min_allocator<int>>>();
test<std::deque<int, safe_allocator<int>>>();
@@ -76,6 +76,14 @@ int main(int, char**) {
test<std::deque<long>>();
test<std::deque<double>>();
+ 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<std::deque, int, double>());
for_all_iterators_and_allocators<int, const int*>([]<class Iter, class Sent, class Alloc>() {
@@ -34,6 +35,14 @@ int main(int, char**) {
test_append_range_exception_safety_throwing_copy<std::deque>();
test_append_range_exception_safety_throwing_allocator<std::deque, int>();
+ return true;
+}
+
+int main(int, char**) {
+ test();
+#if TEST_STD_VER >= 26
+ static_assert(test());
+#endif
return 0;
}
>From 7494b331799c63a61253c6767a24b319573bc06c Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sun, 2 Mar 2025 13:02:44 -0500
Subject: [PATCH 08/41] clang-format
---
.../containers/sequences/deque/deque.cons/move_assign.pass.cpp | 2 +-
.../sequences/deque/deque.cons/move_noexcept.pass.cpp | 2 +-
.../containers/sequences/deque/deque.cons/op_equal.pass.cpp | 2 +-
.../deque/deque.cons/op_equal_initializer_list.pass.cpp | 1 -
.../containers/sequences/deque/deque.cons/size_value.pass.cpp | 3 +--
.../sequences/deque/deque.cons/size_value_alloc.pass.cpp | 2 +-
6 files changed, 5 insertions(+), 7 deletions(-)
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 87f6b5a35ad5e..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
@@ -22,7 +22,7 @@
#include "min_allocator.h"
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]);
typedef test_allocator<MoveOnly> A;
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 194487e64c848..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
@@ -30,7 +30,7 @@ struct some_alloc {
};
TEST_CONSTEXPR_CXX26 bool test() {
- #if defined(_LIBCPP_VERSION)
+#if defined(_LIBCPP_VERSION)
{
typedef std::deque<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
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 89f8b0a0a0f98..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
@@ -27,7 +27,7 @@ void test(const C& x) {
}
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]);
test(std::deque<int>(ab, an));
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 5be8753ed08bb..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
@@ -43,7 +43,6 @@ TEST_CONSTEXPR_CXX26 bool test() {
return true;
}
-
int main(int, char**) {
test();
#if TEST_STD_VER >= 26
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 78590d7b87954..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
@@ -32,7 +32,7 @@ void test(unsigned n, const T& x) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
- test<int, std::allocator<int> >(0, 5);
+ test<int, std::allocator<int> >(0, 5);
test<int, std::allocator<int> >(1, 10);
test<int, std::allocator<int> >(10, 11);
test<int, std::allocator<int> >(1023, -11);
@@ -51,7 +51,6 @@ TEST_CONSTEXPR_CXX26 bool tests() {
return true;
}
-
int main(int, char**) {
tests();
#if TEST_STD_VER >= 26
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 d9c9cb8b41c6e..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
@@ -32,7 +32,7 @@ void test(unsigned n, const T& x, const Allocator& a) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
- {
+ {
std::allocator<int> a;
test(0, 5, a);
test(1, 10, a);
>From ed3b84341d7b2a0e92a281c6c797cd3115946711 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sun, 2 Mar 2025 13:08:11 -0500
Subject: [PATCH 09/41] clang format
---
libcxx/include/deque | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index e277455dd785a..f7cd7a8ae2ecf 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -2587,8 +2587,8 @@ operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y
# endif // _LIBCPP_STD_VER <= 17
template <class _Tp, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 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);
}
>From 457ae753db91763457bfb051e252dca4f44bc430 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Sun, 2 Mar 2025 13:41:20 -0500
Subject: [PATCH 10/41] add more macros
---
libcxx/include/deque | 109 ++++++++++++++++++++++++++-----------------
1 file changed, 65 insertions(+), 44 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index f7cd7a8ae2ecf..54d0556eddd70 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<allocator_type>::value)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque()
+ _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::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 <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l);
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::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<allocator_type>& __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<allocator_type>& __a);
_LIBCPP_HIDE_FROM_ABI deque& operator=(const deque& __c);
@@ -667,13 +671,14 @@ public:
_LIBCPP_HIDE_FROM_ABI deque(initializer_list<value_type> __il);
_LIBCPP_HIDE_FROM_ABI deque(initializer_list<value_type> __il, const allocator_type& __a);
- _LIBCPP_HIDE_FROM_ABI deque& operator=(initializer_list<value_type> __il) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque& operator=(initializer_list<value_type> __il) {
assign(__il);
return *this;
}
- _LIBCPP_HIDE_FROM_ABI deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value);
- _LIBCPP_HIDE_FROM_ABI deque(deque&& __c, const __type_identity_t<allocator_type>& __a);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+ deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(deque&& __c, const __type_identity_t<allocator_type>& __a);
_LIBCPP_HIDE_FROM_ABI deque& operator=(deque&& __c) noexcept(
(__alloc_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<allocator_type>::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<size_type>(__alloc_traits::max_size(__alloc()), numeric_limits<difference_type>::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 <class... _Args>
_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 <class _Tp, class _Allocator>
-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 <class _Tp, class _Allocator>
-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 <class _Tp, class _Allocator>
-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 <class _Tp, class _Allocator>
-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;
>From 37374996ccdc9f42c2ed1fcc662fd286febda7de Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Tue, 8 Apr 2025 23:04:43 -0400
Subject: [PATCH 11/41] fix ftm
---
libcxx/docs/FeatureTestMacroTable.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index 79430a7875b1f..bd73a1d933cb1 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -416,10 +416,10 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_bitset`` ``202306L``
---------------------------------------------------------- -----------------
- ``__cpp_lib_constexpr_deque`` ``202502L``
- ---------------------------------------------------------- -----------------
``__cpp_lib_constexpr_algorithms`` ``202306L``
---------------------------------------------------------- -----------------
+ ``__cpp_lib_constexpr_deque`` ``202502L``
+ ---------------------------------------------------------- -----------------
``__cpp_lib_constexpr_new`` ``202406L``
---------------------------------------------------------- -----------------
``__cpp_lib_constrained_equality`` *unimplemented*
>From 5f9a116d9959272a7701e35d85ad7894e32438d7 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Tue, 8 Apr 2025 23:12:37 -0400
Subject: [PATCH 12/41] fix version
---
libcxx/include/version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/include/version b/libcxx/include/version
index b016292218b3f..e451e49fe1a3d 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -538,9 +538,9 @@ __cpp_lib_void_t 201411L <type_traits>
# undef __cpp_lib_bind_front
# define __cpp_lib_bind_front 202306L
# define __cpp_lib_bitset 202306L
-# define __cpp_lib_constexpr_deque 202502L
# 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
>From 630e5c5c831114e62779405a7238515da3dbd6d7 Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Tue, 8 Apr 2025 23:17:01 -0400
Subject: [PATCH 13/41] update test files in deque.modifiers
---
.../deque/deque.modifiers/assign_range.pass.cpp | 11 ++++++++++-
.../sequences/deque/deque.modifiers/clear.pass.cpp | 10 +++++++++-
.../sequences/deque/deque.modifiers/emplace.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/emplace_back.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/emplace_front.pass.cpp | 10 +++++++++-
.../deque.modifiers/erase_iter.invalidation.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/erase_iter.pass.cpp | 10 +++++++++-
.../erase_iter_iter.invalidation.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/erase_iter_iter.pass.cpp | 10 +++++++++-
.../insert_iter_initializer_list.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/insert_iter_iter.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/insert_range.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/insert_rvalue.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/insert_size_value.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/insert_value.pass.cpp | 10 +++++++++-
.../deque.modifiers/pop_back.invalidation.pass.cpp | 10 +++++++++-
.../sequences/deque/deque.modifiers/pop_back.pass.cpp | 10 +++++++++-
.../deque.modifiers/pop_front.invalidation.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/pop_front.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/prepend_range.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/push_back.pass.cpp | 10 +++++++++-
.../push_back_exception_safety.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/push_back_rvalue.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/push_front.pass.cpp | 10 +++++++++-
.../push_front_exception_safety.pass.cpp | 10 +++++++++-
.../deque/deque.modifiers/push_front_rvalue.pass.cpp | 10 +++++++++-
26 files changed, 235 insertions(+), 26 deletions(-)
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<std::deque, int, double>());
for_all_iterators_and_allocators<int, const int*>([]<class Iter, class Sent, class Alloc>() {
@@ -33,6 +34,14 @@ int main(int, char**) {
test_assign_range_exception_safety_throwing_copy<std::deque>();
test_assign_range_exception_safety_throwing_allocator<std::deque, int>();
+ 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<T> 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<std::deque<Emplaceable, safe_allocator<Emplaceable>> >(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<int> 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<int> 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<int> d(10, 1);
std::deque<int>::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<std::deque<MoveOnly, safe_allocator<MoveOnly> > >();
}
#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<std::deque, int, double>());
for_all_iterators_and_allocators<int, const int*>([]<class Iter, class Sent, class Alloc>() {
@@ -38,6 +38,14 @@ int main(int, char**) {
test_insert_range_exception_safety_throwing_copy<std::deque>();
test_insert_range_exception_safety_throwing_allocator<std::deque, int>();
+ 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<std::deque<MoveOnly, safe_allocator<MoveOnly>> >(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<std::deque<int, safe_allocator<int>> >();
}
#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<std::deque<int, safe_allocator<int>> >();
}
#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<int> 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<std::deque<int, safe_allocator<int>> >(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<int> 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<std::deque<int, min_allocator<int>> >(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<std::deque, int, double>());
for_all_iterators_and_allocators<int, const int*>([]<class Iter, class Sent, class Alloc>() {
@@ -34,6 +34,14 @@ int main(int, char**) {
test_prepend_range_exception_safety_throwing_copy<std::deque>();
test_prepend_range_exception_safety_throwing_allocator<std::deque, int>();
+ 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<std::deque<int, min_allocator<int>> >(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<CMyClass> 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<std::deque<MoveOnly, safe_allocator<MoveOnly>> >(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<std::deque<int, safe_allocator<int>> >(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<CMyClass> 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<std::deque<MoveOnly, safe_allocator<MoveOnly>> >(rng[i], rng[j]);
}
+ return true;
+}
+
+int main(int, char**) {
+ tests();
+#if TEST_STD_VER >= 26
+ static_assert(tests());
+#endif
return 0;
}
>From 5162d6c1b23d79c7e1c37b7b4ad3d5e5dfc6429e Mon Sep 17 00:00:00 2001
From: changkhothuychung <nhat7203 at gmail.com>
Date: Tue, 8 Apr 2025 23:19:53 -0400
Subject: [PATCH 14/41] fix test files in deque.special
---
.../sequences/deque/deque.special/copy.pass.cpp | 10 +++++++++-
.../deque/deque.special/copy_backward.pass.cpp | 10 +++++++++-
.../sequences/deque/deque.special/move.pass.cpp | 10 +++++++++-
.../deque/deque.special/move_backward.pass.cpp | 10 +++++++++-
.../sequences/deque/deque.special/swap.pass.cpp | 10 +++++++++-
.../deque/deque.special/swap_noexcept.pass.cpp | 10 +++++++++-
6 files changed, 54 insertions(+), 6 deletions(-)
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<std::deque<int, min_allocator<int>> >(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<std::deque<int, min_allocator<int>> >(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<std::deque<int, min_allocator<int>> >(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<std::deque<int, min_allocator<int> > >(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<MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
@@ -83,6 +83,14 @@ int main(int, char**) {
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
+ return true;
+}
+
+int main(int, char**) {
+ test();
+#if TEST_STD_VER >= 26
+ static_assert(test());
+#endif
return 0;
}
>From a1feaf78e1ab6aa3b30999488ff807afdf4648d8 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 16:58:37 +0800
Subject: [PATCH 15/41] Add `_LIBCPP_CONSTEXPR_SINCE_CXX26` to `<deque>` except
for ASan
---
libcxx/include/deque | 425 +++++++++++++++++++++++++------------------
1 file changed, 247 insertions(+), 178 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 1c19890911b5c..bfa15fc1fb315 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -301,7 +301,7 @@ public:
typedef random_access_iterator_tag iterator_category;
typedef _Reference reference;
- _LIBCPP_HIDE_FROM_ABI __deque_iterator() _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator() _NOEXCEPT
# if _LIBCPP_STD_VER >= 14
: __m_iter_(nullptr),
__ptr_(nullptr)
@@ -310,15 +310,15 @@ public:
}
template <class _Pp, class _Rp, class _MP, __enable_if_t<is_convertible<_Pp, pointer>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
__deque_iterator(const __deque_iterator<value_type, _Pp, _Rp, _MP, difference_type, _BS>& __it) _NOEXCEPT
: __m_iter_(__it.__m_iter_),
__ptr_(__it.__ptr_) {}
- _LIBCPP_HIDE_FROM_ABI reference operator*() const { return *__ptr_; }
- _LIBCPP_HIDE_FROM_ABI pointer operator->() const { return __ptr_; }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference operator*() const { return *__ptr_; }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pointer operator->() const { return __ptr_; }
- _LIBCPP_HIDE_FROM_ABI __deque_iterator& operator++() {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator& operator++() {
if (++__ptr_ - *__m_iter_ == __block_size) {
++__m_iter_;
__ptr_ = *__m_iter_;
@@ -326,13 +326,13 @@ public:
return *this;
}
- _LIBCPP_HIDE_FROM_ABI __deque_iterator operator++(int) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator operator++(int) {
__deque_iterator __tmp = *this;
++(*this);
return __tmp;
}
- _LIBCPP_HIDE_FROM_ABI __deque_iterator& operator--() {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator& operator--() {
if (__ptr_ == *__m_iter_) {
--__m_iter_;
__ptr_ = *__m_iter_ + __block_size;
@@ -341,13 +341,13 @@ public:
return *this;
}
- _LIBCPP_HIDE_FROM_ABI __deque_iterator operator--(int) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator operator--(int) {
__deque_iterator __tmp = *this;
--(*this);
return __tmp;
}
- _LIBCPP_HIDE_FROM_ABI __deque_iterator& operator+=(difference_type __n) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator& operator+=(difference_type __n) {
if (__n != 0) {
__n += __ptr_ - *__m_iter_;
if (__n > 0) {
@@ -363,34 +363,41 @@ public:
return *this;
}
- _LIBCPP_HIDE_FROM_ABI __deque_iterator& operator-=(difference_type __n) { return *this += -__n; }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator& operator-=(difference_type __n) {
+ return *this += -__n;
+ }
- _LIBCPP_HIDE_FROM_ABI __deque_iterator operator+(difference_type __n) const {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator operator+(difference_type __n) const {
__deque_iterator __t(*this);
__t += __n;
return __t;
}
- _LIBCPP_HIDE_FROM_ABI __deque_iterator operator-(difference_type __n) const {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator operator-(difference_type __n) const {
__deque_iterator __t(*this);
__t -= __n;
return __t;
}
- _LIBCPP_HIDE_FROM_ABI friend __deque_iterator operator+(difference_type __n, const __deque_iterator& __it) {
+ _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_iterator
+ operator+(difference_type __n, const __deque_iterator& __it) {
return __it + __n;
}
- _LIBCPP_HIDE_FROM_ABI friend difference_type operator-(const __deque_iterator& __x, const __deque_iterator& __y) {
+ _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX26 difference_type
+ operator-(const __deque_iterator& __x, const __deque_iterator& __y) {
if (__x != __y)
return (__x.__m_iter_ - __y.__m_iter_) * __block_size + (__x.__ptr_ - *__x.__m_iter_) -
(__y.__ptr_ - *__y.__m_iter_);
return 0;
}
- _LIBCPP_HIDE_FROM_ABI reference operator[](difference_type __n) const { return *(*this + __n); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference operator[](difference_type __n) const {
+ return *(*this + __n);
+ }
- _LIBCPP_HIDE_FROM_ABI friend bool operator==(const __deque_iterator& __x, const __deque_iterator& __y) {
+ _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
+ operator==(const __deque_iterator& __x, const __deque_iterator& __y) {
return __x.__ptr_ == __y.__ptr_;
}
@@ -416,7 +423,8 @@ public:
# else
- _LIBCPP_HIDE_FROM_ABI friend strong_ordering operator<=>(const __deque_iterator& __x, const __deque_iterator& __y) {
+ _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX26 strong_ordering
+ operator<=>(const __deque_iterator& __x, const __deque_iterator& __y) {
if (__x.__m_iter_ < __y.__m_iter_)
return strong_ordering::less;
@@ -439,7 +447,8 @@ public:
# endif // _LIBCPP_STD_VER >= 20
private:
- _LIBCPP_HIDE_FROM_ABI explicit __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR_SINCE_CXX26
+ __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT
: __m_iter_(__m),
__ptr_(__p) {}
@@ -464,15 +473,22 @@ public:
using __segment_iterator _LIBCPP_NODEBUG = _MapPointer;
using __local_iterator _LIBCPP_NODEBUG = _Pointer;
- static _LIBCPP_HIDE_FROM_ABI __segment_iterator __segment(_Iterator __iter) { return __iter.__m_iter_; }
- static _LIBCPP_HIDE_FROM_ABI __local_iterator __local(_Iterator __iter) { return __iter.__ptr_; }
- static _LIBCPP_HIDE_FROM_ABI __local_iterator __begin(__segment_iterator __iter) { return *__iter; }
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __segment_iterator __segment(_Iterator __iter) {
+ return __iter.__m_iter_;
+ }
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __local_iterator __local(_Iterator __iter) {
+ return __iter.__ptr_;
+ }
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __local_iterator __begin(__segment_iterator __iter) {
+ return *__iter;
+ }
- static _LIBCPP_HIDE_FROM_ABI __local_iterator __end(__segment_iterator __iter) {
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __local_iterator __end(__segment_iterator __iter) {
return *__iter + _Iterator::__block_size;
}
- static _LIBCPP_HIDE_FROM_ABI _Iterator __compose(__segment_iterator __segment, __local_iterator __local) {
+ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _Iterator
+ __compose(__segment_iterator __segment, __local_iterator __local) {
if (__segment && __local == __end(__segment)) {
++__segment;
return _Iterator(__segment, *__segment);
@@ -540,7 +556,7 @@ public:
private:
struct __deque_block_range {
- explicit _LIBCPP_HIDE_FROM_ABI __deque_block_range(pointer __b, pointer __e) _NOEXCEPT
+ explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_block_range(pointer __b, pointer __e) _NOEXCEPT
: __begin_(__b),
__end_(__e) {}
const pointer __begin_;
@@ -551,21 +567,27 @@ private:
iterator __pos_;
const iterator __end_;
- _LIBCPP_HIDE_FROM_ABI __deque_range(iterator __pos, iterator __e) _NOEXCEPT : __pos_(__pos), __end_(__e) {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_range(iterator __pos, iterator __e) _NOEXCEPT
+ : __pos_(__pos),
+ __end_(__e) {}
- explicit _LIBCPP_HIDE_FROM_ABI operator bool() const _NOEXCEPT { return __pos_ != __end_; }
+ explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 operator bool() const _NOEXCEPT {
+ return __pos_ != __end_;
+ }
- _LIBCPP_HIDE_FROM_ABI __deque_range begin() const { return *this; }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_range begin() const { return *this; }
- _LIBCPP_HIDE_FROM_ABI __deque_range end() const { return __deque_range(__end_, __end_); }
- _LIBCPP_HIDE_FROM_ABI __deque_block_range operator*() const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_range end() const {
+ return __deque_range(__end_, __end_);
+ }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_block_range operator*() const _NOEXCEPT {
if (__pos_.__m_iter_ == __end_.__m_iter_) {
return __deque_block_range(__pos_.__ptr_, __end_.__ptr_);
}
return __deque_block_range(__pos_.__ptr_, *__pos_.__m_iter_ + __block_size);
}
- _LIBCPP_HIDE_FROM_ABI __deque_range& operator++() _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __deque_range& operator++() _NOEXCEPT {
if (__pos_.__m_iter_ == __end_.__m_iter_) {
__pos_ = __end_;
} else {
@@ -575,19 +597,23 @@ private:
return *this;
}
- _LIBCPP_HIDE_FROM_ABI friend bool operator==(__deque_range const& __lhs, __deque_range const& __rhs) {
+ _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
+ operator==(__deque_range const& __lhs, __deque_range const& __rhs) {
return __lhs.__pos_ == __rhs.__pos_;
}
- _LIBCPP_HIDE_FROM_ABI friend bool operator!=(__deque_range const& __lhs, __deque_range const& __rhs) {
+ _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
+ operator!=(__deque_range const& __lhs, __deque_range const& __rhs) {
return !(__lhs == __rhs);
}
};
struct _ConstructTransaction {
- _LIBCPP_HIDE_FROM_ABI _ConstructTransaction(deque* __db, __deque_block_range& __r)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _ConstructTransaction(deque* __db, __deque_block_range& __r)
: __pos_(__r.__begin_), __end_(__r.__end_), __begin_(__r.__begin_), __base_(__db) {}
- _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() { __base_->__size() += (__pos_ - __begin_); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 ~_ConstructTransaction() {
+ __base_->__size() += (__pos_ - __begin_);
+ }
pointer __pos_;
const pointer __end_;
@@ -611,7 +637,7 @@ public:
__annotate_new(0);
}
- _LIBCPP_HIDE_FROM_ABI ~deque() {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 ~deque() {
clear();
__annotate_delete();
typename __map::iterator __i = __map_.begin();
@@ -625,11 +651,11 @@ public:
__annotate_new(0);
}
- explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n);
+ explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(size_type __n);
# if _LIBCPP_STD_VER >= 14
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);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(size_type __n, const value_type& __v);
template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
@@ -668,8 +694,9 @@ public:
_LIBCPP_HIDE_FROM_ABI deque& operator=(const deque& __c);
# ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI deque(initializer_list<value_type> __il);
- _LIBCPP_HIDE_FROM_ABI deque(initializer_list<value_type> __il, const allocator_type& __a);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(initializer_list<value_type> __il);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+ deque(initializer_list<value_type> __il, const allocator_type& __a);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque& operator=(initializer_list<value_type> __il) {
assign(__il);
@@ -691,13 +718,13 @@ public:
__enable_if_t<__has_input_iterator_category<_InputIter>::value &&
!__has_random_access_iterator_category<_InputIter>::value,
int> = 0>
- _LIBCPP_HIDE_FROM_ABI void assign(_InputIter __f, _InputIter __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void assign(_InputIter __f, _InputIter __l);
template <class _RAIter, __enable_if_t<__has_random_access_iterator_category<_RAIter>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI void assign(_RAIter __f, _RAIter __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void assign(_RAIter __f, _RAIter __l);
# if _LIBCPP_STD_VER >= 23
template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void assign_range(_Range&& __range) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void assign_range(_Range&& __range) {
if constexpr (ranges::random_access_range<_Range>) {
auto __n = static_cast<size_type>(ranges::distance(__range));
__assign_with_size_random_access(ranges::begin(__range), __n);
@@ -712,11 +739,13 @@ public:
}
# endif
- _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void assign(size_type __n, const value_type& __v);
_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_; }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type& __alloc() _NOEXCEPT { return __alloc_; }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const allocator_type& __alloc() const _NOEXCEPT {
+ return __alloc_;
+ }
// iterators:
@@ -767,8 +796,8 @@ public:
// capacity:
_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 _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type& __size() _NOEXCEPT { return __size_; }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const size_type& __size() const _NOEXCEPT { return __size_; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const _NOEXCEPT {
return std::min<size_type>(__alloc_traits::max_size(__alloc()), numeric_limits<difference_type>::max());
@@ -791,14 +820,14 @@ public:
_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);
- _LIBCPP_HIDE_FROM_ABI void push_back(const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void push_front(const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void push_back(const value_type& __v);
# ifndef _LIBCPP_CXX03_LANG
# if _LIBCPP_STD_VER >= 17
template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference emplace_front(_Args&&... __args);
template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI reference emplace_back(_Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference emplace_back(_Args&&... __args);
# else
template <class... _Args>
_LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
@@ -806,42 +835,47 @@ public:
_LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
# endif
template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace(const_iterator __p, _Args&&... __args);
_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>
- _LIBCPP_HIDE_FROM_ABI void prepend_range(_Range&& __range) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void prepend_range(_Range&& __range) {
insert_range(begin(), std::forward<_Range>(__range));
}
template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI void append_range(_Range&& __range) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void append_range(_Range&& __range) {
insert_range(end(), std::forward<_Range>(__range));
}
# endif
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, value_type&& __v);
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, initializer_list<value_type> __il) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
+ insert(const_iterator __p, initializer_list<value_type> __il) {
return insert(__p, __il.begin(), __il.end());
}
# endif // _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v);
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
+ insert(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InputIter __f, _InputIter __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
+ insert(const_iterator __p, _InputIter __f, _InputIter __l);
template <class _ForwardIterator,
__enable_if_t<__has_exactly_forward_iterator_category<_ForwardIterator>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
+ insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l);
template <class _BiIter, __enable_if_t<__has_bidirectional_iterator_category<_BiIter>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _BiIter __f, _BiIter __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, _BiIter __f, _BiIter __l);
# if _LIBCPP_STD_VER >= 23
template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI iterator insert_range(const_iterator __position, _Range&& __range) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
+ insert_range(const_iterator __position, _Range&& __range) {
if constexpr (ranges::bidirectional_range<_Range>) {
auto __n = static_cast<size_type>(ranges::distance(__range));
return __insert_bidirectional(__position, ranges::begin(__range), ranges::end(__range), __n);
@@ -856,20 +890,20 @@ public:
}
# endif
- _LIBCPP_HIDE_FROM_ABI void pop_front();
- _LIBCPP_HIDE_FROM_ABI void pop_back();
- _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p);
- _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void pop_front();
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void pop_back();
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __p);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __f, const_iterator __l);
- _LIBCPP_HIDE_FROM_ABI void swap(deque& __c)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(deque& __c)
# if _LIBCPP_STD_VER >= 14
_NOEXCEPT;
# else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);
# endif
- _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() _NOEXCEPT;
- _LIBCPP_HIDE_FROM_ABI bool __invariants() const {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __invariants() const {
if (!__map_.__invariants())
return false;
if (__map_.size() >= size_type(-1) / __block_size)
@@ -891,20 +925,20 @@ public:
return true;
}
- _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(deque& __c)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign_alloc(deque& __c)
_NOEXCEPT_(!__alloc_traits::propagate_on_container_move_assignment::value ||
is_nothrow_move_assignable<allocator_type>::value) {
__move_assign_alloc(__c, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>());
}
- _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(deque& __c, true_type)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign_alloc(deque& __c, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
__alloc() = std::move(__c.__alloc());
}
- _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(deque&, false_type) _NOEXCEPT {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign_alloc(deque&, false_type) _NOEXCEPT {}
- _LIBCPP_HIDE_FROM_ABI void __move_assign(deque& __c)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign(deque& __c)
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value&&
is_nothrow_move_assignable<allocator_type>::value) {
__map_ = std::move(__c.__map_);
@@ -914,18 +948,24 @@ public:
__c.__start_ = __c.__size() = 0;
}
- _LIBCPP_HIDE_FROM_ABI static size_type __recommend_blocks(size_type __n) {
+ _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __recommend_blocks(size_type __n) {
return __n / __block_size + (__n % __block_size != 0);
}
- _LIBCPP_HIDE_FROM_ABI size_type __capacity() const {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __capacity() const {
return __map_.size() == 0 ? 0 : __map_.size() * __block_size - 1;
}
- _LIBCPP_HIDE_FROM_ABI size_type __block_count() const { return __map_.size(); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __block_count() const { return __map_.size(); }
- _LIBCPP_HIDE_FROM_ABI size_type __front_spare() const { return __start_; }
- _LIBCPP_HIDE_FROM_ABI size_type __front_spare_blocks() const { return __front_spare() / __block_size; }
- _LIBCPP_HIDE_FROM_ABI size_type __back_spare() const { return __capacity() - (__start_ + size()); }
- _LIBCPP_HIDE_FROM_ABI size_type __back_spare_blocks() const { return __back_spare() / __block_size; }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __front_spare() const { return __start_; }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __front_spare_blocks() const {
+ return __front_spare() / __block_size;
+ }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __back_spare() const {
+ return __capacity() - (__start_ + size());
+ }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type __back_spare_blocks() const {
+ return __back_spare() / __block_size;
+ }
private:
enum __asan_annotation_type { __asan_unposion, __asan_poison };
@@ -1179,7 +1219,7 @@ public:
private:
# endif // _LIBCPP_HAS_ASAN
- _LIBCPP_HIDE_FROM_ABI bool __maybe_remove_front_spare(bool __keep_one = true) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __maybe_remove_front_spare(bool __keep_one = true) {
if (__front_spare_blocks() >= 2 || (!__keep_one && __front_spare_blocks())) {
__annotate_whole_block(0, __asan_unposion);
__alloc_traits::deallocate(__alloc(), __map_.front(), __block_size);
@@ -1190,7 +1230,7 @@ private:
return false;
}
- _LIBCPP_HIDE_FROM_ABI bool __maybe_remove_back_spare(bool __keep_one = true) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __maybe_remove_back_spare(bool __keep_one = true) {
if (__back_spare_blocks() >= 2 || (!__keep_one && __back_spare_blocks())) {
__annotate_whole_block(__map_.size() - 1, __asan_unposion);
__alloc_traits::deallocate(__alloc(), __map_.back(), __block_size);
@@ -1201,54 +1241,60 @@ private:
}
template <class _Iterator, class _Sentinel>
- _LIBCPP_HIDE_FROM_ABI void __assign_with_sentinel(_Iterator __f, _Sentinel __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __assign_with_sentinel(_Iterator __f, _Sentinel __l);
template <class _RandomAccessIterator>
- _LIBCPP_HIDE_FROM_ABI void __assign_with_size_random_access(_RandomAccessIterator __f, difference_type __n);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+ __assign_with_size_random_access(_RandomAccessIterator __f, difference_type __n);
template <class _Iterator>
- _LIBCPP_HIDE_FROM_ABI void __assign_with_size(_Iterator __f, difference_type __n);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __assign_with_size(_Iterator __f, difference_type __n);
template <class _Iterator, class _Sentinel>
- _LIBCPP_HIDE_FROM_ABI iterator __insert_with_sentinel(const_iterator __p, _Iterator __f, _Sentinel __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
+ __insert_with_sentinel(const_iterator __p, _Iterator __f, _Sentinel __l);
template <class _Iterator>
- _LIBCPP_HIDE_FROM_ABI iterator __insert_with_size(const_iterator __p, _Iterator __f, size_type __n);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
+ __insert_with_size(const_iterator __p, _Iterator __f, size_type __n);
template <class _BiIter, class _Sentinel>
- _LIBCPP_HIDE_FROM_ABI iterator
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
__insert_bidirectional(const_iterator __p, _BiIter __f, _Sentinel __sent, size_type __n);
template <class _BiIter>
- _LIBCPP_HIDE_FROM_ABI iterator __insert_bidirectional(const_iterator __p, _BiIter __f, _BiIter __l, size_type __n);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
+ __insert_bidirectional(const_iterator __p, _BiIter __f, _BiIter __l, size_type __n);
template <class _InpIter, __enable_if_t<__has_exactly_input_iterator_category<_InpIter>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI void __append(_InpIter __f, _InpIter __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __append(_InpIter __f, _InpIter __l);
template <class _ForIter, __enable_if_t<__has_forward_iterator_category<_ForIter>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI void __append(_ForIter __f, _ForIter __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __append(_ForIter __f, _ForIter __l);
template <class _InputIterator>
- _LIBCPP_HIDE_FROM_ABI void __append_with_size(_InputIterator __from, size_type __n);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __append_with_size(_InputIterator __from, size_type __n);
template <class _InputIterator, class _Sentinel>
- _LIBCPP_HIDE_FROM_ABI void __append_with_sentinel(_InputIterator __f, _Sentinel __l);
-
- _LIBCPP_HIDE_FROM_ABI void __append(size_type __n);
- _LIBCPP_HIDE_FROM_ABI void __append(size_type __n, const value_type& __v);
- _LIBCPP_HIDE_FROM_ABI void __erase_to_end(const_iterator __f);
- _LIBCPP_HIDE_FROM_ABI void __add_front_capacity();
- _LIBCPP_HIDE_FROM_ABI void __add_front_capacity(size_type __n);
- _LIBCPP_HIDE_FROM_ABI void __add_back_capacity();
- _LIBCPP_HIDE_FROM_ABI void __add_back_capacity(size_type __n);
- _LIBCPP_HIDE_FROM_ABI iterator __move_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt);
- _LIBCPP_HIDE_FROM_ABI iterator
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __append_with_sentinel(_InputIterator __f, _Sentinel __l);
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __append(size_type __n);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __append(size_type __n, const value_type& __v);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __erase_to_end(const_iterator __f);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __add_front_capacity();
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __add_front_capacity(size_type __n);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __add_back_capacity();
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __add_back_capacity(size_type __n);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
+ __move_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
__move_backward_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt);
- _LIBCPP_HIDE_FROM_ABI void __move_construct_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt);
- _LIBCPP_HIDE_FROM_ABI void
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+ __move_construct_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
__move_construct_backward_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt);
- _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const deque& __c) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __copy_assign_alloc(const deque& __c) {
__copy_assign_alloc(__c, integral_constant<bool, __alloc_traits::propagate_on_container_copy_assignment::value>());
}
- _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const deque& __c, true_type) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __copy_assign_alloc(const deque& __c, true_type) {
if (__alloc() != __c.__alloc()) {
clear();
shrink_to_fit();
@@ -1257,11 +1303,11 @@ private:
__map_.__alloc_ = __c.__map_.__alloc_;
}
- _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const deque&, false_type) {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __copy_assign_alloc(const deque&, false_type) {}
- _LIBCPP_HIDE_FROM_ABI void __move_assign(deque& __c, true_type)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign(deque& __c, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
- _LIBCPP_HIDE_FROM_ABI void __move_assign(deque& __c, false_type);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign(deque& __c, false_type);
};
template <class _Tp, class _Alloc>
@@ -1290,7 +1336,7 @@ deque(from_range_t, _Range&&, _Alloc = _Alloc()) -> deque<ranges::range_value_t<
# endif
template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>::deque(size_type __n) : __start_(0), __size_(0) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::deque(size_type __n) : __start_(0), __size_(0) {
__annotate_new(0);
if (__n > 0)
__append(__n);
@@ -1298,7 +1344,7 @@ deque<_Tp, _Allocator>::deque(size_type __n) : __start_(0), __size_(0) {
# if _LIBCPP_STD_VER >= 14
template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
+_LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
__annotate_new(0);
if (__n > 0)
@@ -1307,7 +1353,8 @@ deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
# endif
template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v) : __start_(0), __size_(0) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v)
+ : __start_(0), __size_(0) {
__annotate_new(0);
if (__n > 0)
__append(__n, __v);
@@ -1315,21 +1362,21 @@ deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v) : __start_(0
template <class _Tp, class _Allocator>
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> >
-deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l) : __start_(0), __size_(0) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l) : __start_(0), __size_(0) {
__annotate_new(0);
__append(__f, __l);
}
template <class _Tp, class _Allocator>
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> >
-deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l, const allocator_type& __a)
+_LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l, const allocator_type& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
__annotate_new(0);
__append(__f, __l);
}
template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>::deque(const deque& __c)
+_LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::deque(const deque& __c)
: __map_(__pointer_allocator(__alloc_traits::select_on_container_copy_construction(__c.__alloc()))),
__start_(0),
__size_(0),
@@ -1339,6 +1386,7 @@ deque<_Tp, _Allocator>::deque(const deque& __c)
}
template <class _Tp, class _Allocator>
+_LIBCPP_CONSTEXPR_SINCE_CXX26
deque<_Tp, _Allocator>::deque(const deque& __c, const __type_identity_t<allocator_type>& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
__annotate_new(0);
@@ -1346,7 +1394,7 @@ deque<_Tp, _Allocator>::deque(const deque& __c, const __type_identity_t<allocato
}
template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(const deque& __c) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(const deque& __c) {
if (this != std::addressof(__c)) {
__copy_assign_alloc(__c);
assign(__c.begin(), __c.end());
@@ -1357,12 +1405,14 @@ deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(const deque& __c) {
# ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il) : __start_(0), __size_(0) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il)
+ : __start_(0), __size_(0) {
__annotate_new(0);
__append(__il.begin(), __il.end());
}
template <class _Tp, class _Allocator>
+_LIBCPP_CONSTEXPR_SINCE_CXX26
deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il, const allocator_type& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
__annotate_new(0);
@@ -1370,7 +1420,8 @@ deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il, const allocator
}
template <class _Tp, class _Allocator>
-inline deque<_Tp, _Allocator>::deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value)
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26
+deque<_Tp, _Allocator>::deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value)
: __map_(std::move(__c.__map_)),
__start_(std::move(__c.__start_)),
__size_(std::move(__c.__size_)),
@@ -1380,7 +1431,8 @@ inline deque<_Tp, _Allocator>::deque(deque&& __c) noexcept(is_nothrow_move_const
}
template <class _Tp, class _Allocator>
-inline deque<_Tp, _Allocator>::deque(deque&& __c, const __type_identity_t<allocator_type>& __a)
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26
+deque<_Tp, _Allocator>::deque(deque&& __c, const __type_identity_t<allocator_type>& __a)
: __map_(std::move(__c.__map_), __pointer_allocator(__a)),
__start_(std::move(__c.__start_)),
__size_(std::move(__c.__size_)),
@@ -1398,7 +1450,7 @@ inline deque<_Tp, _Allocator>::deque(deque&& __c, const __type_identity_t<alloca
}
template <class _Tp, class _Allocator>
-inline deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(deque&& __c) noexcept(
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(deque&& __c) noexcept(
(__alloc_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<allocator_type>::value) ||
__alloc_traits::is_always_equal::value) {
@@ -1407,7 +1459,7 @@ inline deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(deque&& __c) no
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__move_assign(deque& __c, false_type) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__move_assign(deque& __c, false_type) {
if (__alloc() != __c.__alloc()) {
typedef move_iterator<iterator> _Ip;
assign(_Ip(__c.begin()), _Ip(__c.end()));
@@ -1416,8 +1468,8 @@ void deque<_Tp, _Allocator>::__move_assign(deque& __c, false_type) {
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__move_assign(deque& __c,
- true_type) noexcept(is_nothrow_move_assignable<allocator_type>::value) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__move_assign(deque& __c, true_type) noexcept(
+ is_nothrow_move_assignable<allocator_type>::value) {
clear();
shrink_to_fit();
__move_assign(__c);
@@ -1430,13 +1482,14 @@ template <class _InputIter,
__enable_if_t<__has_input_iterator_category<_InputIter>::value &&
!__has_random_access_iterator_category<_InputIter>::value,
int> >
-void deque<_Tp, _Allocator>::assign(_InputIter __f, _InputIter __l) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::assign(_InputIter __f, _InputIter __l) {
__assign_with_sentinel(__f, __l);
}
template <class _Tp, class _Allocator>
template <class _Iterator, class _Sentinel>
-_LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__assign_with_sentinel(_Iterator __f, _Sentinel __l) {
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+deque<_Tp, _Allocator>::__assign_with_sentinel(_Iterator __f, _Sentinel __l) {
iterator __i = begin();
iterator __e = end();
for (; __f != __l && __i != __e; ++__f, (void)++__i)
@@ -1449,13 +1502,13 @@ _LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__assign_with_sentinel(_Itera
template <class _Tp, class _Allocator>
template <class _RAIter, __enable_if_t<__has_random_access_iterator_category<_RAIter>::value, int> >
-void deque<_Tp, _Allocator>::assign(_RAIter __f, _RAIter __l) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::assign(_RAIter __f, _RAIter __l) {
__assign_with_size_random_access(__f, __l - __f);
}
template <class _Tp, class _Allocator>
template <class _RandomAccessIterator>
-_LIBCPP_HIDE_FROM_ABI void
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
deque<_Tp, _Allocator>::__assign_with_size_random_access(_RandomAccessIterator __f, difference_type __n) {
if (static_cast<size_type>(__n) > size()) {
auto __l = __f + size();
@@ -1467,7 +1520,8 @@ deque<_Tp, _Allocator>::__assign_with_size_random_access(_RandomAccessIterator _
template <class _Tp, class _Allocator>
template <class _Iterator>
-_LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__assign_with_size(_Iterator __f, difference_type __n) {
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+deque<_Tp, _Allocator>::__assign_with_size(_Iterator __f, difference_type __n) {
if (static_cast<size_type>(__n) > size()) {
auto __added_size = __n - size();
@@ -1484,7 +1538,7 @@ _LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__assign_with_size(_Iterator
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v) {
if (__n > size()) {
std::fill_n(begin(), size(), __v);
__n -= size();
@@ -1494,12 +1548,12 @@ void deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v) {
}
template <class _Tp, class _Allocator>
-inline _Allocator deque<_Tp, _Allocator>::get_allocator() const _NOEXCEPT {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 _Allocator deque<_Tp, _Allocator>::get_allocator() const _NOEXCEPT {
return __alloc();
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::resize(size_type __n) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::resize(size_type __n) {
if (__n > size())
__append(__n - size());
else if (__n < size())
@@ -1507,7 +1561,7 @@ void deque<_Tp, _Allocator>::resize(size_type __n) {
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::resize(size_type __n, const value_type& __v) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::resize(size_type __n, const value_type& __v) {
if (__n > size())
__append(__n - size(), __v);
else if (__n < size())
@@ -1515,7 +1569,7 @@ void deque<_Tp, _Allocator>::resize(size_type __n, const value_type& __v) {
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT {
allocator_type& __a = __alloc();
if (empty()) {
__annotate_delete();
@@ -1532,14 +1586,15 @@ void deque<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT {
}
template <class _Tp, class _Allocator>
-inline typename deque<_Tp, _Allocator>::reference deque<_Tp, _Allocator>::operator[](size_type __i) _NOEXCEPT {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::reference
+deque<_Tp, _Allocator>::operator[](size_type __i) _NOEXCEPT {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < size(), "deque::operator[] index out of bounds");
size_type __p = __start_ + __i;
return *(*(__map_.begin() + __p / __block_size) + __p % __block_size);
}
template <class _Tp, class _Allocator>
-inline typename deque<_Tp, _Allocator>::const_reference
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::const_reference
deque<_Tp, _Allocator>::operator[](size_type __i) const _NOEXCEPT {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__i < size(), "deque::operator[] index out of bounds");
size_type __p = __start_ + __i;
@@ -1547,7 +1602,8 @@ deque<_Tp, _Allocator>::operator[](size_type __i) const _NOEXCEPT {
}
template <class _Tp, class _Allocator>
-inline typename deque<_Tp, _Allocator>::reference deque<_Tp, _Allocator>::at(size_type __i) {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::reference
+deque<_Tp, _Allocator>::at(size_type __i) {
if (__i >= size())
std::__throw_out_of_range("deque");
size_type __p = __start_ + __i;
@@ -1555,7 +1611,8 @@ inline typename deque<_Tp, _Allocator>::reference deque<_Tp, _Allocator>::at(siz
}
template <class _Tp, class _Allocator>
-inline typename deque<_Tp, _Allocator>::const_reference deque<_Tp, _Allocator>::at(size_type __i) const {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::const_reference
+deque<_Tp, _Allocator>::at(size_type __i) const {
if (__i >= size())
std::__throw_out_of_range("deque");
size_type __p = __start_ + __i;
@@ -1563,33 +1620,38 @@ inline typename deque<_Tp, _Allocator>::const_reference deque<_Tp, _Allocator>::
}
template <class _Tp, class _Allocator>
-inline typename deque<_Tp, _Allocator>::reference deque<_Tp, _Allocator>::front() _NOEXCEPT {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::reference
+deque<_Tp, _Allocator>::front() _NOEXCEPT {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "deque::front called on an empty deque");
return *(*(__map_.begin() + __start_ / __block_size) + __start_ % __block_size);
}
template <class _Tp, class _Allocator>
-inline typename deque<_Tp, _Allocator>::const_reference deque<_Tp, _Allocator>::front() const _NOEXCEPT {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::const_reference
+deque<_Tp, _Allocator>::front() const _NOEXCEPT {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "deque::front called on an empty deque");
return *(*(__map_.begin() + __start_ / __block_size) + __start_ % __block_size);
}
template <class _Tp, class _Allocator>
-inline typename deque<_Tp, _Allocator>::reference deque<_Tp, _Allocator>::back() _NOEXCEPT {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::reference
+deque<_Tp, _Allocator>::back() _NOEXCEPT {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "deque::back called on an empty deque");
size_type __p = size() + __start_ - 1;
return *(*(__map_.begin() + __p / __block_size) + __p % __block_size);
}
template <class _Tp, class _Allocator>
-inline typename deque<_Tp, _Allocator>::const_reference deque<_Tp, _Allocator>::back() const _NOEXCEPT {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::const_reference
+deque<_Tp, _Allocator>::back() const _NOEXCEPT {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "deque::back called on an empty deque");
size_type __p = size() + __start_ - 1;
return *(*(__map_.begin() + __p / __block_size) + __p % __block_size);
}
template <class _Tp, class _Allocator>
-void _LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::push_back(const value_type& __v) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 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();
@@ -1600,7 +1662,7 @@ void _LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::push_back(const value
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::push_front(const value_type& __v) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::push_front(const value_type& __v) {
allocator_type& __a = __alloc();
if (__front_spare() == 0)
__add_front_capacity();
@@ -1613,7 +1675,7 @@ void deque<_Tp, _Allocator>::push_front(const value_type& __v) {
# ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::push_back(value_type&& __v) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::push_back(value_type&& __v) {
allocator_type& __a = __alloc();
if (__back_spare() == 0)
__add_back_capacity();
@@ -1626,7 +1688,7 @@ void deque<_Tp, _Allocator>::push_back(value_type&& __v) {
template <class _Tp, class _Allocator>
template <class... _Args>
# if _LIBCPP_STD_VER >= 17
-typename deque<_Tp, _Allocator>::reference
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::reference
# else
void
# endif
@@ -1644,7 +1706,7 @@ deque<_Tp, _Allocator>::emplace_back(_Args&&... __args) {
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::push_front(value_type&& __v) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::push_front(value_type&& __v) {
allocator_type& __a = __alloc();
if (__front_spare() == 0)
__add_front_capacity();
@@ -1658,7 +1720,7 @@ void deque<_Tp, _Allocator>::push_front(value_type&& __v) {
template <class _Tp, class _Allocator>
template <class... _Args>
# if _LIBCPP_STD_VER >= 17
-typename deque<_Tp, _Allocator>::reference
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::reference
# else
void
# endif
@@ -1725,7 +1787,8 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v) {
template <class _Tp, class _Allocator>
template <class... _Args>
-typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args) {
size_type __pos = __p - begin();
size_type __to_end = size() - __pos;
allocator_type& __a = __alloc();
@@ -1828,7 +1891,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v) {
}
template <class _Tp, class _Allocator>
-typename deque<_Tp, _Allocator>::iterator _LIBCPP_CONSTEXPR_SINCE_CXX26
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
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;
@@ -1881,14 +1944,14 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
template <class _Tp, class _Allocator>
template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> >
-typename deque<_Tp, _Allocator>::iterator
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::insert(const_iterator __p, _InputIter __f, _InputIter __l) {
return __insert_with_sentinel(__p, __f, __l);
}
template <class _Tp, class _Allocator>
template <class _Iterator, class _Sentinel>
-_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __p, _Iterator __f, _Sentinel __l) {
__split_buffer<value_type, allocator_type&> __buf(__alloc());
__buf.__construct_at_end_with_sentinel(std::move(__f), std::move(__l));
@@ -1898,14 +1961,14 @@ deque<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __p, _Iterator __f
template <class _Tp, class _Allocator>
template <class _ForwardIterator, __enable_if_t<__has_exactly_forward_iterator_category<_ForwardIterator>::value, int> >
-typename deque<_Tp, _Allocator>::iterator
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l) {
return __insert_with_size(__p, __f, std::distance(__f, __l));
}
template <class _Tp, class _Allocator>
template <class _Iterator>
-_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::__insert_with_size(const_iterator __p, _Iterator __f, size_type __n) {
__split_buffer<value_type, allocator_type&> __buf(__n, 0, __alloc());
__buf.__construct_at_end_with_size(__f, __n);
@@ -1915,20 +1978,21 @@ deque<_Tp, _Allocator>::__insert_with_size(const_iterator __p, _Iterator __f, si
template <class _Tp, class _Allocator>
template <class _BiIter, __enable_if_t<__has_bidirectional_iterator_category<_BiIter>::value, int> >
-typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l) {
return __insert_bidirectional(__p, __f, __l, std::distance(__f, __l));
}
template <class _Tp, class _Allocator>
template <class _BiIter, class _Sentinel>
-_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::__insert_bidirectional(const_iterator __p, _BiIter __f, _Sentinel, size_type __n) {
return __insert_bidirectional(__p, __f, std::next(__f, __n), __n);
}
template <class _Tp, class _Allocator>
template <class _BiIter>
-_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::__insert_bidirectional(const_iterator __p, _BiIter __f, _BiIter __l, size_type __n) {
size_type __pos = __p - begin();
size_type __to_end = size() - __pos;
@@ -1988,13 +2052,14 @@ deque<_Tp, _Allocator>::__insert_bidirectional(const_iterator __p, _BiIter __f,
template <class _Tp, class _Allocator>
template <class _InpIter, __enable_if_t<__has_exactly_input_iterator_category<_InpIter>::value, int> >
-void deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIter __l) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIter __l) {
__append_with_sentinel(__f, __l);
}
template <class _Tp, class _Allocator>
template <class _InputIterator, class _Sentinel>
-_LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__append_with_sentinel(_InputIterator __f, _Sentinel __l) {
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+deque<_Tp, _Allocator>::__append_with_sentinel(_InputIterator __f, _Sentinel __l) {
for (; __f != __l; ++__f)
# ifdef _LIBCPP_CXX03_LANG
push_back(*__f);
@@ -2005,13 +2070,14 @@ _LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__append_with_sentinel(_Input
template <class _Tp, class _Allocator>
template <class _ForIter, __enable_if_t<__has_forward_iterator_category<_ForIter>::value, int> >
-void deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l) {
__append_with_size(__f, std::distance(__f, __l));
}
template <class _Tp, class _Allocator>
template <class _InputIterator>
-_LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__append_with_size(_InputIterator __f, size_type __n) {
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+deque<_Tp, _Allocator>::__append_with_size(_InputIterator __f, size_type __n) {
allocator_type& __a = __alloc();
size_type __back_capacity = __back_spare();
if (__n > __back_capacity)
@@ -2028,7 +2094,7 @@ _LIBCPP_HIDE_FROM_ABI void deque<_Tp, _Allocator>::__append_with_size(_InputIter
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__append(size_type __n) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__append(size_type __n) {
allocator_type& __a = __alloc();
size_type __back_capacity = __back_spare();
if (__n > __back_capacity)
@@ -2044,7 +2110,7 @@ void deque<_Tp, _Allocator>::__append(size_type __n) {
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v) {
allocator_type& __a = __alloc();
size_type __back_capacity = __back_spare();
if (__n > __back_capacity)
@@ -2062,7 +2128,7 @@ void deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v) {
// Create front capacity for one block of elements.
// Strong guarantee. Either do it or don't touch anything.
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__add_front_capacity() {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__add_front_capacity() {
allocator_type& __a = __alloc();
if (__back_spare() >= __block_size) {
__start_ += __block_size;
@@ -2109,7 +2175,7 @@ void deque<_Tp, _Allocator>::__add_front_capacity() {
// Create front capacity for __n elements.
// Strong guarantee. Either do it or don't touch anything.
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__add_front_capacity(size_type __n) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__add_front_capacity(size_type __n) {
allocator_type& __a = __alloc();
size_type __nb = __recommend_blocks(__n + __map_.empty());
// Number of unused blocks at back:
@@ -2185,7 +2251,7 @@ void deque<_Tp, _Allocator>::__add_front_capacity(size_type __n) {
// Create back capacity for one block of elements.
// Strong guarantee. Either do it or don't touch anything.
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__add_back_capacity() {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__add_back_capacity() {
allocator_type& __a = __alloc();
if (__front_spare() >= __block_size) {
__start_ -= __block_size;
@@ -2231,7 +2297,7 @@ void deque<_Tp, _Allocator>::__add_back_capacity() {
// Create back capacity for __n elements.
// Strong guarantee. Either do it or don't touch anything.
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__add_back_capacity(size_type __n) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__add_back_capacity(size_type __n) {
allocator_type& __a = __alloc();
size_type __nb = __recommend_blocks(__n + __map_.empty());
// Number of unused blocks at front:
@@ -2308,7 +2374,7 @@ void deque<_Tp, _Allocator>::__add_back_capacity(size_type __n) {
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::pop_front() {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::pop_front() {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "deque::pop_front called on an empty deque");
size_type __old_sz = size();
size_type __old_start = __start_;
@@ -2322,7 +2388,7 @@ void deque<_Tp, _Allocator>::pop_front() {
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::pop_back() {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::pop_back() {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "deque::pop_back called on an empty deque");
size_type __old_sz = size();
size_type __old_start = __start_;
@@ -2337,7 +2403,7 @@ void deque<_Tp, _Allocator>::pop_back() {
// move assign [__f, __l) to [__r, __r + (__l-__f)).
// If __vt points into [__f, __l), then subtract (__f - __r) from __vt.
template <class _Tp, class _Allocator>
-typename deque<_Tp, _Allocator>::iterator
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt) {
// as if
// for (; __f != __l; ++__f, ++__r)
@@ -2363,7 +2429,7 @@ deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __
// move assign [__f, __l) to [__r - (__l-__f), __r) backwards.
// If __vt points into [__f, __l), then add (__r - __l) to __vt.
template <class _Tp, class _Allocator>
-typename deque<_Tp, _Allocator>::iterator
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::__move_backward_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt) {
// as if
// while (__f != __l)
@@ -2390,7 +2456,8 @@ deque<_Tp, _Allocator>::__move_backward_and_check(iterator __f, iterator __l, it
// move construct [__f, __l) to [__r, __r + (__l-__f)).
// If __vt points into [__f, __l), then add (__r - __f) to __vt.
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void
+deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator __l, iterator __r, const_pointer& __vt) {
allocator_type& __a = __alloc();
// as if
// for (; __f != __l; ++__r, ++__f, ++__size())
@@ -2416,7 +2483,7 @@ void deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator _
// move construct [__f, __l) to [__r - (__l-__f), __r) backwards.
// If __vt points into [__f, __l), then subtract (__l - __r) from __vt.
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__move_construct_backward_and_check(
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__move_construct_backward_and_check(
iterator __f, iterator __l, iterator __r, const_pointer& __vt) {
allocator_type& __a = __alloc();
// as if
@@ -2449,7 +2516,8 @@ void deque<_Tp, _Allocator>::__move_construct_backward_and_check(
}
template <class _Tp, class _Allocator>
-typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::erase(const_iterator __f) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::erase(const_iterator __f) {
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
__f != end(), "deque::erase(iterator) called with a non-dereferenceable iterator");
size_type __old_sz = size();
@@ -2476,7 +2544,8 @@ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::erase(const_it
}
template <class _Tp, class _Allocator>
-typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l) {
_LIBCPP_ASSERT_VALID_INPUT_RANGE(__f <= __l, "deque::erase(first, last) called with an invalid range");
size_type __old_sz = size();
size_type __old_start = __start_;
@@ -2509,7 +2578,7 @@ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::erase(const_it
}
template <class _Tp, class _Allocator>
-void deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f) {
size_type __old_sz = size();
size_type __old_start = __start_;
iterator __e = end();
@@ -2528,7 +2597,7 @@ void deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f) {
}
template <class _Tp, class _Allocator>
-inline void deque<_Tp, _Allocator>::swap(deque& __c)
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::swap(deque& __c)
# if _LIBCPP_STD_VER >= 14
_NOEXCEPT
# else
@@ -2542,7 +2611,7 @@ inline void deque<_Tp, _Allocator>::swap(deque& __c)
}
template <class _Tp, class _Allocator>
-inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
__annotate_delete();
allocator_type& __a = __alloc();
for (iterator __i = begin(), __e = end(); __i != __e; ++__i)
>From 45fc545b4987481f0a1db56fb3a087189fc6bb8f Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 17:06:15 +0800
Subject: [PATCH 16/41] `_LIBCPP_CONSTEXPR_SINCE_CXX26` for ASan for `deque` w/
early return
---
libcxx/include/deque | 66 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 57 insertions(+), 9 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index bfa15fc1fb315..1df5d87ecdc61 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -975,11 +975,16 @@ private:
__asan_back_moved,
};
- _LIBCPP_HIDE_FROM_ABI void __annotate_from_to(
+ _LIBCPP_HIDE_FROM_ABI void _LIBCPP_CONSTEXPR_SINCE_CXX26 __annotate_from_to(
size_type __beg,
size_type __end,
__asan_annotation_type __annotation_type,
__asan_annotation_place __place) const _NOEXCEPT {
+# if _LIBCPP_STD_VER >= 26
+ if consteval {
+ return;
+ }
+# endif // _LIBCPP_STD_VER >= 26
(void)__beg;
(void)__end;
(void)__annotation_type;
@@ -1080,7 +1085,12 @@ private:
# endif // _LIBCPP_HAS_ASAN
}
- _LIBCPP_HIDE_FROM_ABI void __annotate_new(size_type __current_size) const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __annotate_new(size_type __current_size) const _NOEXCEPT {
+# if _LIBCPP_STD_VER >= 26
+ if consteval {
+ return;
+ }
+# endif // _LIBCPP_STD_VER >= 26
(void)__current_size;
# if _LIBCPP_HAS_ASAN
if (__current_size == 0)
@@ -1092,7 +1102,12 @@ private:
# endif // _LIBCPP_HAS_ASAN
}
- _LIBCPP_HIDE_FROM_ABI void __annotate_delete() const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __annotate_delete() const _NOEXCEPT {
+# if _LIBCPP_STD_VER >= 26
+ if consteval {
+ return;
+ }
+# endif // _LIBCPP_STD_VER >= 26
# if _LIBCPP_HAS_ASAN
if (empty()) {
for (size_t __i = 0; __i < __map_.size(); ++__i) {
@@ -1105,21 +1120,37 @@ private:
# endif // _LIBCPP_HAS_ASAN
}
- _LIBCPP_HIDE_FROM_ABI void __annotate_increase_front(size_type __n) const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __annotate_increase_front(size_type __n) const _NOEXCEPT {
+# if _LIBCPP_STD_VER >= 26
+ if consteval {
+ return;
+ }
+# endif // _LIBCPP_STD_VER >= 26
(void)__n;
# if _LIBCPP_HAS_ASAN
__annotate_from_to(__start_ - __n, __start_, __asan_unposion, __asan_front_moved);
# endif
}
- _LIBCPP_HIDE_FROM_ABI void __annotate_increase_back(size_type __n) const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __annotate_increase_back(size_type __n) const _NOEXCEPT {
+# if _LIBCPP_STD_VER >= 26
+ if consteval {
+ return;
+ }
+# endif // _LIBCPP_STD_VER >= 26
(void)__n;
# if _LIBCPP_HAS_ASAN
__annotate_from_to(__start_ + size(), __start_ + size() + __n, __asan_unposion, __asan_back_moved);
# endif
}
- _LIBCPP_HIDE_FROM_ABI void __annotate_shrink_front(size_type __old_size, size_type __old_start) const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+ __annotate_shrink_front(size_type __old_size, size_type __old_start) const _NOEXCEPT {
+# if _LIBCPP_STD_VER >= 26
+ if consteval {
+ return;
+ }
+# endif // _LIBCPP_STD_VER >= 26
(void)__old_size;
(void)__old_start;
# if _LIBCPP_HAS_ASAN
@@ -1127,7 +1158,13 @@ private:
# endif
}
- _LIBCPP_HIDE_FROM_ABI void __annotate_shrink_back(size_type __old_size, size_type __old_start) const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+ __annotate_shrink_back(size_type __old_size, size_type __old_start) const _NOEXCEPT {
+# if _LIBCPP_STD_VER >= 26
+ if consteval {
+ return;
+ }
+# endif // _LIBCPP_STD_VER >= 26
(void)__old_size;
(void)__old_start;
# if _LIBCPP_HAS_ASAN
@@ -1135,12 +1172,23 @@ private:
# endif
}
- _LIBCPP_HIDE_FROM_ABI void __annotate_poison_block(const void* __beginning, const void* __end) const _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+ __annotate_poison_block(const void* __beginning, const void* __end) const _NOEXCEPT {
+# if _LIBCPP_STD_VER >= 26
+ if consteval {
+ return;
+ }
+# endif // _LIBCPP_STD_VER >= 26
std::__annotate_double_ended_contiguous_container<_Allocator>(__beginning, __end, __beginning, __end, __end, __end);
}
- _LIBCPP_HIDE_FROM_ABI void
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
__annotate_whole_block(size_t __block_index, __asan_annotation_type __annotation_type) const _NOEXCEPT {
+# if _LIBCPP_STD_VER >= 26
+ if consteval {
+ return;
+ }
+# endif // _LIBCPP_STD_VER >= 26
(void)__block_index;
(void)__annotation_type;
# if _LIBCPP_HAS_ASAN
>From 7e23ddf3ae914618861502a64e6d839ecef5323e Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 17:29:50 +0800
Subject: [PATCH 17/41] Clang-format `<deque>` after merging
---
libcxx/include/deque | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index ac6ff7f01da27..2076c52ed41ec 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -794,7 +794,8 @@ public:
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() _NOEXCEPT {
return reverse_iterator(end());
}
- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const _NOEXCEPT {
+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
+ rbegin() const _NOEXCEPT {
return const_reverse_iterator(end());
}
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() _NOEXCEPT {
@@ -804,9 +805,14 @@ public:
return const_reverse_iterator(begin());
}
- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const _NOEXCEPT { return begin(); }
- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const _NOEXCEPT { return end(); }
- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const _NOEXCEPT {
+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const _NOEXCEPT {
+ return begin();
+ }
+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const _NOEXCEPT {
+ return end();
+ }
+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator
+ crbegin() const _NOEXCEPT {
return const_reverse_iterator(end());
}
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const _NOEXCEPT {
@@ -814,7 +820,9 @@ public:
}
// capacity:
- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const _NOEXCEPT { return __size(); }
+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const _NOEXCEPT {
+ return __size();
+ }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type& __size() _NOEXCEPT { return __size_; }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const size_type& __size() const _NOEXCEPT { return __size_; }
@@ -831,7 +839,8 @@ public:
// element access:
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference operator[](size_type __i) _NOEXCEPT;
- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference operator[](size_type __i) const _NOEXCEPT;
+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference
+ operator[](size_type __i) const _NOEXCEPT;
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference at(size_type __i);
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference at(size_type __i) const;
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference front() _NOEXCEPT;
@@ -883,14 +892,18 @@ public:
}
# endif
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, value_type&& __v) { return __emplace(__p, std::move(__v)); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, value_type&& __v) {
+ return __emplace(__p, std::move(__v));
+ }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
insert(const_iterator __p, initializer_list<value_type> __il) {
return insert(__p, __il.begin(), __il.end());
}
# endif // _LIBCPP_CXX03_LANG
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, const value_type& __v) { return __emplace(__p, __v); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __p, const value_type& __v) {
+ return __emplace(__p, __v);
+ }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
insert(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> = 0>
>From 9432759de871c046498918a86df1cd0a55ce33e5 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 17:36:09 +0800
Subject: [PATCH 18/41] Regenerate FTM tests after merging
---
.../deque.version.compile.pass.cpp | 42 +++++++++----------
.../version.version.compile.pass.cpp | 42 +++++++++----------
2 files changed, 42 insertions(+), 42 deletions(-)
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 e19f8d58452db..81a7613639ea4 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
@@ -22,10 +22,10 @@
# ifdef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_containers_ranges
@@ -48,10 +48,10 @@
# ifdef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_containers_ranges
@@ -77,10 +77,10 @@
# endif
# if __cpp_lib_allocator_traits_is_always_equal != 201411L
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_containers_ranges
@@ -109,10 +109,10 @@
# endif
# if __cpp_lib_allocator_traits_is_always_equal != 201411L
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_containers_ranges
@@ -144,10 +144,10 @@
# endif
# if __cpp_lib_allocator_traits_is_always_equal != 201411L
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifndef __cpp_lib_containers_ranges
@@ -182,13 +182,13 @@
# endif
# if __cpp_lib_allocator_traits_is_always_equal != 201411L
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
+# 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"
+# 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
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 2169ae221af0e..ebdb6aced2986 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
@@ -198,10 +198,10 @@
# ifdef __cpp_lib_constexpr_complex
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -1122,10 +1122,10 @@
# ifdef __cpp_lib_constexpr_complex
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -2148,10 +2148,10 @@
# ifdef __cpp_lib_constexpr_complex
# error "__cpp_lib_constexpr_complex should not be defined before c++20"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifdef __cpp_lib_constexpr_dynamic_alloc
@@ -3405,10 +3405,10 @@
# endif
# if __cpp_lib_constexpr_complex != 201711L
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifndef __cpp_lib_constexpr_dynamic_alloc
@@ -4887,10 +4887,10 @@
# endif
# if __cpp_lib_constexpr_complex != 201711L
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
-# endif
+# endif
-# ifdef __cpp_lib_constexpr_deque
-# error "__cpp_lib_constexpr_deque should not be defined before c++26"
+# ifdef __cpp_lib_constexpr_deque
+# error "__cpp_lib_constexpr_deque should not be defined before c++26"
# endif
# ifndef __cpp_lib_constexpr_dynamic_alloc
@@ -6576,13 +6576,13 @@
# endif
# if __cpp_lib_constexpr_complex != 201711L
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
-# endif
+# 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"
+# 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
>From 04adc9f9b6c4658de599a10fc31f5887a0067c17 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 17:39:39 +0800
Subject: [PATCH 19/41] Clang-format `<deque>` again per CI
---
libcxx/include/deque | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 2076c52ed41ec..7c5cb7ee3935f 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -433,8 +433,8 @@ public:
# else
- _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX26 strong_ordering
- operator<=>(const __deque_iterator& __x, const __deque_iterator& __y) {
+ _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR_SINCE_CXX26
+ strong_ordering operator<=>(const __deque_iterator& __x, const __deque_iterator& __y) {
if (__x.__m_iter_ < __y.__m_iter_)
return strong_ordering::less;
@@ -685,8 +685,8 @@ public:
# if _LIBCPP_STD_VER >= 23
template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
- 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));
@@ -918,8 +918,8 @@ public:
# if _LIBCPP_STD_VER >= 23
template <_ContainerCompatibleRange<_Tp> _Range>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator
- insert_range(const_iterator __position, _Range&& __range) {
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert_range(const_iterator __position, _Range&& __range) {
if constexpr (ranges::bidirectional_range<_Range>) {
auto __n = static_cast<size_type>(ranges::distance(__range));
return __insert_bidirectional(__position, ranges::begin(__range), ranges::end(__range), __n);
@@ -2635,8 +2635,8 @@ swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y) _NOEXCEPT_(_NOEXC
# if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::size_type
-erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
+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());
return __old_size - __c.size();
>From 184cc26bebdf24bb1919584c0b6038c4914d1e1c Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 17:58:06 +0800
Subject: [PATCH 20/41] Fix-up missed additions and misplaced `#endif`
---
libcxx/include/deque | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 7c5cb7ee3935f..fc01a1009f64b 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -679,7 +679,7 @@ public:
}
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
- _LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(_InputIter __f, _InputIter __l);
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(_InputIter __f, _InputIter __l, const allocator_type& __a);
@@ -703,7 +703,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
deque(const deque& __c, const __type_identity_t<allocator_type>& __a);
- _LIBCPP_HIDE_FROM_ABI deque& operator=(const deque& __c);
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque& operator=(const deque& __c);
# ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(initializer_list<value_type> __il);
@@ -718,7 +718,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(deque&& __c, const __type_identity_t<allocator_type>& __a);
- _LIBCPP_HIDE_FROM_ABI deque& operator=(deque&& __c) noexcept(
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque& operator=(deque&& __c) noexcept(
(__alloc_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<allocator_type>::value) ||
__alloc_traits::is_always_equal::value);
@@ -1810,6 +1810,7 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args) {
return *begin();
# endif
}
+# endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
template <class... _Args>
@@ -1861,8 +1862,6 @@ deque<_Tp, _Allocator>::__emplace(const_iterator __p, _Args&&... __args) {
return begin() + __pos;
}
-# endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_type& __v) {
>From 9fcb8c7fa20d33c4cf90dc1e46672b3eae5b3064 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 18:11:35 +0800
Subject: [PATCH 21/41] Fix-up mischanges
---
libcxx/include/deque | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index fc01a1009f64b..a1733bb700332 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -1723,8 +1723,7 @@ deque<_Tp, _Allocator>::back() const _NOEXCEPT {
}
template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX26 void _LIBCPP_CONSTEXPR_SINCE_CXX26
-deque<_Tp, _Allocator>::push_back(const value_type& __v) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::push_back(const value_type& __v) {
allocator_type& __a = __alloc();
if (__back_spare() == 0)
__add_back_capacity();
@@ -1814,8 +1813,8 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args) {
template <class _Tp, class _Allocator>
template <class... _Args>
-_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
-deque<_Tp, _Allocator>::__emplace(const_iterator __p, _Args&&... __args) {
+_LIBCPP_CONSTEXPR_SINCE_CXX26
+ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::__emplace(const_iterator __p, _Args&&... __args) {
size_type __pos = __p - begin();
size_type __to_end = size() - __pos;
allocator_type& __a = __alloc();
>From 36de5ab35dfdd4a75a3423c220acaa31c99090cb Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 19:15:02 +0800
Subject: [PATCH 22/41] Revert changes to unrelated test files
`push_{back,front}_exception_safety.pass.cpp` are actually related, but
they're not yet constexpr-friendly.
---
.../sequences/deque/deque.cons/deduct.verify.cpp | 10 +---------
.../deque/deque.cons/default_noexcept.pass.cpp | 10 +---------
.../sequences/deque/deque.cons/dtor_noexcept.pass.cpp | 10 +---------
.../sequences/deque/deque.cons/move_noexcept.pass.cpp | 10 +---------
.../push_back_exception_safety.pass.cpp | 10 +---------
.../push_front_exception_safety.pass.cpp | 10 +---------
.../deque/deque.special/swap_noexcept.pass.cpp | 10 +---------
.../test/std/containers/sequences/deque/types.pass.cpp | 10 +---------
8 files changed, 8 insertions(+), 72 deletions(-)
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 cbdcee4be91f5..61e58b08ca263 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 {};
-TEST_CONSTEXPR_CXX26 bool test() {
+int main(int, char**) {
// Test the explicit deduction guides
// Test the implicit deduction guides
@@ -34,14 +34,6 @@ TEST_CONSTEXPR_CXX26 bool test() {
// Also, we can't use {} instead of parens, because that constructs a
// deque<allocator<int>, allocator<allocator<int>>>
}
- 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_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
index a37504dcb5568..244fef829f521 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);
};
-TEST_CONSTEXPR_CXX26 bool test() {
+int main(int, char**) {
#if defined(_LIBCPP_VERSION)
{
typedef std::deque<MoveOnly> C;
@@ -48,14 +48,6 @@ TEST_CONSTEXPR_CXX26 bool test() {
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::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 db44366279f8e..338a0fa6b832d 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
@@ -28,7 +28,7 @@ struct some_alloc {
void allocate(std::size_t);
};
-TEST_CONSTEXPR_CXX26 bool test() {
+int main(int, char**) {
{
typedef std::deque<MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
@@ -47,14 +47,6 @@ TEST_CONSTEXPR_CXX26 bool test() {
static_assert(!std::is_nothrow_destructible<C>::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/move_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
index 0b817ca34011c..37e8a801e9d71 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);
};
-TEST_CONSTEXPR_CXX26 bool test() {
+int main(int, char**) {
#if defined(_LIBCPP_VERSION)
{
typedef std::deque<MoveOnly> C;
@@ -48,14 +48,6 @@ TEST_CONSTEXPR_CXX26 bool test() {
static_assert(!std::is_nothrow_move_constructible<C>::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.modifiers/push_back_exception_safety.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp
index 68e4be4387fb4..10da5b02f96f1 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); }
-TEST_CONSTEXPR_CXX26 bool test() {
+int main(int, char**) {
CMyClass instance(42);
{
std::deque<CMyClass> vec;
@@ -100,14 +100,6 @@ TEST_CONSTEXPR_CXX26 bool test() {
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_exception_safety.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp
index 76ad9367cce25..f4b77bcf09f62 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); }
-TEST_CONSTEXPR_CXX26 bool test() {
+int main(int, char**) {
CMyClass instance(42);
{
std::deque<CMyClass> vec;
@@ -100,14 +100,6 @@ TEST_CONSTEXPR_CXX26 bool test() {
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.special/swap_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
index 97c61322f4e73..6347496d67c15 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;
};
-TEST_CONSTEXPR_CXX26 bool test() {
+int main(int, char**) {
{
typedef std::deque<MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
@@ -83,14 +83,6 @@ TEST_CONSTEXPR_CXX26 bool test() {
static_assert(noexcept(swap(std::declval<C&>(), std::declval<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/types.pass.cpp b/libcxx/test/std/containers/sequences/deque/types.pass.cpp
index da12694aa14c0..8184d55873d20 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() {
"");
}
-TEST_CONSTEXPR_CXX26 bool tests() {
+int main(int, char**) {
test<int, test_allocator<int> >();
test<int*, std::allocator<int*> >();
test<Copyable, test_allocator<Copyable> >();
@@ -106,14 +106,6 @@ TEST_CONSTEXPR_CXX26 bool tests() {
"");
}
#endif
- return false;
-}
-
-int main(int, char**) {
- tests();
-#if TEST_STD_VER >= 26
- static_assert(tests());
-#endif
return 0;
}
>From 2bbb3c285b820ee7cffec4f248e37c81e3c285d8 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 19:15:51 +0800
Subject: [PATCH 23/41] Fix-up `constexpr` additions in `<deque>` and
`<__memory/allocator_destructor.h>`
---
libcxx/include/__memory/allocator_destructor.h | 8 ++++++--
libcxx/include/deque | 4 +++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/libcxx/include/__memory/allocator_destructor.h b/libcxx/include/__memory/allocator_destructor.h
index aac92a23fa0d4..a4a50a659f647 100644
--- a/libcxx/include/__memory/allocator_destructor.h
+++ b/libcxx/include/__memory/allocator_destructor.h
@@ -31,8 +31,12 @@ class __allocator_destructor {
size_type __s_;
public:
- _LIBCPP_HIDE_FROM_ABI __allocator_destructor(_Alloc& __a, size_type __s) _NOEXCEPT : __alloc_(__a), __s_(__s) {}
- _LIBCPP_HIDE_FROM_ABI void operator()(pointer __p) _NOEXCEPT { __alloc_traits::deallocate(__alloc_, __p, __s_); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __allocator_destructor(_Alloc& __a, size_type __s) _NOEXCEPT
+ : __alloc_(__a),
+ __s_(__s) {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void operator()(pointer __p) _NOEXCEPT {
+ __alloc_traits::deallocate(__alloc_, __p, __s_);
+ }
};
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/deque b/libcxx/include/deque
index a1733bb700332..497819b492ecf 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -723,7 +723,9 @@ public:
is_nothrow_move_assignable<allocator_type>::value) ||
__alloc_traits::is_always_equal::value);
- _LIBCPP_HIDE_FROM_ABI void assign(initializer_list<value_type> __il) { assign(__il.begin(), __il.end()); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void assign(initializer_list<value_type> __il) {
+ assign(__il.begin(), __il.end());
+ }
# endif // _LIBCPP_CXX03_LANG
template <class _InputIter,
>From 4398238af25e5c05f63a900174e7274275f4d695 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 19:16:24 +0800
Subject: [PATCH 24/41] Fix-up `constexpr` addition in test files
---
.../sequences/deque/deque.capacity/access.pass.cpp | 2 +-
.../deque/deque.capacity/resize_size.pass.cpp | 6 +++---
.../deque/deque.capacity/resize_size_value.pass.cpp | 6 +++---
.../deque/deque.capacity/shrink_to_fit.pass.cpp | 6 +++---
.../sequences/deque/deque.cons/alloc.pass.cpp | 2 +-
.../deque/deque.cons/assign_iter_iter.pass.cpp | 12 ++++++------
.../deque/deque.cons/assign_size_value.pass.cpp | 6 +++---
.../sequences/deque/deque.cons/copy.pass.cpp | 2 +-
.../sequences/deque/deque.cons/copy_alloc.pass.cpp | 2 +-
.../sequences/deque/deque.cons/default.pass.cpp | 2 +-
.../sequences/deque/deque.cons/iter_iter.pass.cpp | 8 ++++----
.../deque/deque.cons/iter_iter_alloc.pass.cpp | 6 +++---
.../sequences/deque/deque.cons/op_equal.pass.cpp | 2 +-
.../sequences/deque/deque.cons/size.pass.cpp | 8 ++++----
.../sequences/deque/deque.cons/size_value.pass.cpp | 2 +-
.../deque/deque.cons/size_value_alloc.pass.cpp | 2 +-
.../sequences/deque/deque.erasure/erase.pass.cpp | 4 ++--
.../sequences/deque/deque.erasure/erase_if.pass.cpp | 4 ++--
.../deque/deque.modifiers/append_range.pass.cpp | 6 ++++--
.../deque/deque.modifiers/assign_range.pass.cpp | 6 ++++--
.../sequences/deque/deque.modifiers/emplace.pass.cpp | 6 +++---
.../deque/deque.modifiers/emplace_back.pass.cpp | 6 +++---
.../deque/deque.modifiers/emplace_front.pass.cpp | 6 +++---
.../deque.modifiers/erase_iter.invalidation.pass.cpp | 4 ++--
.../deque/deque.modifiers/erase_iter.pass.cpp | 8 ++++----
.../erase_iter_iter.invalidation.pass.cpp | 4 ++--
.../deque/deque.modifiers/erase_iter_iter.pass.cpp | 8 ++++----
.../deque/deque.modifiers/insert_iter_iter.pass.cpp | 12 ++++++------
.../deque/deque.modifiers/insert_range.pass.cpp | 6 ++++--
.../deque/deque.modifiers/insert_rvalue.pass.cpp | 6 +++---
.../deque/deque.modifiers/insert_size_value.pass.cpp | 8 ++++----
.../deque/deque.modifiers/insert_value.pass.cpp | 8 ++++----
.../deque.modifiers/pop_back.invalidation.pass.cpp | 2 +-
.../deque/deque.modifiers/pop_back.pass.cpp | 6 +++---
.../deque.modifiers/pop_front.invalidation.pass.cpp | 2 +-
.../deque/deque.modifiers/pop_front.pass.cpp | 6 +++---
.../deque/deque.modifiers/prepend_range.pass.cpp | 6 ++++--
.../deque/deque.modifiers/push_back.pass.cpp | 4 ++--
.../deque/deque.modifiers/push_back_rvalue.pass.cpp | 4 ++--
.../deque/deque.modifiers/push_front.pass.cpp | 6 +++---
.../deque/deque.modifiers/push_front_rvalue.pass.cpp | 6 +++---
.../sequences/deque/deque.special/copy.pass.cpp | 4 ++--
.../deque/deque.special/copy_backward.pass.cpp | 4 ++--
.../sequences/deque/deque.special/move.pass.cpp | 2 +-
.../deque/deque.special/move_backward.pass.cpp | 2 +-
.../sequences/deque/deque.special/swap.pass.cpp | 4 ++--
46 files changed, 121 insertions(+), 113 deletions(-)
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 fa2ab8c2f45b1..b2b1bde63c7a6 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
@@ -29,7 +29,7 @@
#include "test_macros.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 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 8bd735a2cedd5..8961110d67311 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
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -43,7 +43,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1, int size) {
+TEST_CONSTEXPR_CXX26 void test(C& c1, int size) {
typedef typename C::const_iterator CI;
typename C::size_type c1_osize = c1.size();
c1.resize(size);
@@ -58,7 +58,7 @@ void test(C& c1, int size) {
}
template <class C>
-void testN(int start, int N, int M) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
C c1 = make<C>(N, start);
test(c1, M);
}
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 9e1d3ff39e18f..97f83fbabd1a6 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
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -43,7 +43,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1, int size, int x) {
+TEST_CONSTEXPR_CXX26 void test(C& c1, int size, int x) {
typedef typename C::const_iterator CI;
typename C::size_type c1_osize = c1.size();
c1.resize(size, x);
@@ -58,7 +58,7 @@ void test(C& c1, int size, int x) {
}
template <class C>
-void testN(int start, int N, int M) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
C c1 = make<C>(N, start);
test(c1, M, -10);
}
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 fed42d2b691c9..ac7a969810ec1 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
@@ -18,7 +18,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -37,7 +37,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1) {
+TEST_CONSTEXPR_CXX26 void test(C& c1) {
C s = c1;
c1.shrink_to_fit();
assert(c1 == s);
@@ -45,7 +45,7 @@ void test(C& c1) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
C c1 = make<C>(N, start);
test(c1);
}
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 55bbc0652737c..64f87d231d180 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,7 +20,7 @@
#include "min_allocator.h"
template <class T, class Allocator>
-void test_util(const Allocator& a) {
+TEST_CONSTEXPR_CXX26 void test_util(const Allocator& a) {
std::deque<T, Allocator> d(a);
assert(d.size() == 0);
assert(d.get_allocator() == a);
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 5a1b29c02ca2e..e0f57e2aa5b50 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
@@ -24,7 +24,7 @@
#endif
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -43,7 +43,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1, const C& c2) {
+TEST_CONSTEXPR_CXX26 void test(C& c1, const C& c2) {
c1.assign(c2.begin(), c2.end());
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
assert(c1 == c2);
@@ -52,14 +52,14 @@ void test(C& c1, const C& c2) {
}
template <class C>
-void testN(int start, int N, int M) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
C c1 = make<C>(N, start);
C c2 = make<C>(M);
test(c1, c2);
}
template <class C>
-void testI(C& c1, const C& c2) {
+TEST_CONSTEXPR_CXX26 void testI(C& c1, const C& c2) {
typedef typename C::const_iterator CI;
typedef cpp17_input_iterator<CI> ICI;
c1.assign(ICI(c2.begin()), ICI(c2.end()));
@@ -70,13 +70,13 @@ void testI(C& c1, const C& c2) {
}
template <class C>
-void testNI(int start, int N, int M) {
+TEST_CONSTEXPR_CXX26 void testNI(int start, int N, int M) {
C c1 = make<C>(N, start);
C c2 = make<C>(M);
testI(c1, c2);
}
-void basic_test() {
+TEST_CONSTEXPR_CXX26 void basic_test() {
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 97857088a77e4..59ef7d4e6c4aa 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
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -39,7 +39,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1, int size, int v) {
+TEST_CONSTEXPR_CXX26 void test(C& c1, int size, int v) {
typedef typename C::const_iterator CI;
c1.assign(size, v);
assert(c1.size() == static_cast<std::size_t>(size));
@@ -50,7 +50,7 @@ void test(C& c1, int size, int v) {
}
template <class C>
-void testN(int start, int N, int M) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
C c1 = make<C>(N, start);
test(c1, M, -10);
}
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 4de61a8445f1c..901b01263d1b7 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
@@ -19,7 +19,7 @@
#include "min_allocator.h"
template <class C>
-void test(const C& x) {
+TEST_CONSTEXPR_CXX26 void test(const C& x) {
C c(x);
assert(c == x);
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
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 a93a28204abab..265330c996c30 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
@@ -19,7 +19,7 @@
#include "min_allocator.h"
template <class C>
-void test(const C& x, const typename C::allocator_type& a) {
+TEST_CONSTEXPR_CXX26 void test(const C& x, const typename C::allocator_type& a) {
C c(x, a);
assert(c == x);
assert(c.get_allocator() == a);
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 f6fa7c642ff6c..cd8e49ecffc34 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
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class T, class Allocator>
-void test() {
+TEST_CONSTEXPR_CXX26 void test() {
std::deque<T, Allocator> d;
assert(d.size() == 0);
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d));
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 dcc4296faeff1..e63b6b589bc1c 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
@@ -25,7 +25,7 @@
#endif
template <class InputIterator>
-void test(InputIterator f, InputIterator l) {
+TEST_CONSTEXPR_CXX26 void test(InputIterator f, InputIterator l) {
typedef typename std::iterator_traits<InputIterator>::value_type T;
typedef std::allocator<T> Allocator;
typedef std::deque<T, Allocator> C;
@@ -37,7 +37,7 @@ void test(InputIterator f, InputIterator l) {
}
template <class Allocator, class InputIterator>
-void test(InputIterator f, InputIterator l) {
+TEST_CONSTEXPR_CXX26 void test(InputIterator f, InputIterator l) {
typedef typename std::iterator_traits<InputIterator>::value_type T;
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
@@ -49,7 +49,7 @@ void test(InputIterator f, InputIterator l) {
assert(*i == *f);
}
-void basic_test() {
+TEST_CONSTEXPR_CXX26 void basic_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]);
test(cpp17_input_iterator<const int*>(ab), cpp17_input_iterator<const int*>(an));
@@ -62,7 +62,7 @@ void basic_test() {
#endif
}
-void test_emplacable_concept() {
+TEST_CONSTEXPR_CXX26 void test_emplacable_concept() {
#if TEST_STD_VER >= 11
int arr1[] = {42};
int arr2[] = {1, 101, 42};
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 048fc5a351bf6..41b15d56d8cdc 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
@@ -26,7 +26,7 @@
#endif
template <class InputIterator, class Allocator>
-void test(InputIterator f, InputIterator l, const Allocator& a) {
+TEST_CONSTEXPR_CXX26 void test(InputIterator f, InputIterator l, const Allocator& a) {
typedef typename std::iterator_traits<InputIterator>::value_type T;
typedef std::deque<T, Allocator> C;
C d(f, l, a);
@@ -37,7 +37,7 @@ void test(InputIterator f, InputIterator l, const Allocator& a) {
assert(std::equal(d.begin(), d.end(), f));
}
-void basic_test() {
+TEST_CONSTEXPR_CXX26 void basic_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]);
test(cpp17_input_iterator<const int*>(ab), cpp17_input_iterator<const int*>(an), test_allocator<int>(3));
@@ -52,7 +52,7 @@ void basic_test() {
#endif
}
-void test_emplacable_concept() {
+TEST_CONSTEXPR_CXX26 void test_emplacable_concept() {
#if TEST_STD_VER >= 11
int arr1[] = {42};
int arr2[] = {1, 101, 42};
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 1905db90c4156..d1acbc0520986 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
@@ -18,7 +18,7 @@
#include "min_allocator.h"
template <class C>
-void test(const C& x) {
+TEST_CONSTEXPR_CXX26 void test(const C& x) {
C c;
c = x;
assert(c == x);
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 542288aefc3d0..34e907a7cd166 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
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class T, class Allocator>
-void test2(unsigned n) {
+TEST_CONSTEXPR_CXX26 void test2(unsigned n) {
#if TEST_STD_VER > 11
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
@@ -42,7 +42,7 @@ void test2(unsigned n) {
}
template <class T, class Allocator>
-void test1(unsigned n) {
+TEST_CONSTEXPR_CXX26 void test1(unsigned n) {
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
assert(DefaultOnly::count == 0);
@@ -61,7 +61,7 @@ void test1(unsigned n) {
}
template <class T, class Allocator>
-void test3(unsigned n, Allocator const& alloc = Allocator()) {
+TEST_CONSTEXPR_CXX26 void test3(unsigned n, Allocator const& alloc = Allocator()) {
#if TEST_STD_VER > 11
typedef std::deque<T, Allocator> C;
{
@@ -77,7 +77,7 @@ void test3(unsigned n, Allocator const& alloc = Allocator()) {
}
template <class T, class Allocator>
-void test(unsigned n) {
+TEST_CONSTEXPR_CXX26 void test(unsigned n) {
test1<T, Allocator>(n);
test2<T, Allocator>(n);
}
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 caeea946d0461..d44637ec93bde 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
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class T, class Allocator>
-void test(unsigned n, const T& x) {
+TEST_CONSTEXPR_CXX26 void test(unsigned n, const T& x) {
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
C d(n, x);
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 4fd29052d59f1..9ceb911f374d2 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
@@ -19,7 +19,7 @@
#include "min_allocator.h"
template <class T, class Allocator>
-void test(unsigned n, const T& x, const Allocator& a) {
+TEST_CONSTEXPR_CXX26 void test(unsigned n, const T& x, const Allocator& a) {
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
C d(n, x, a);
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 583a229775d02..820f4bd455d63 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
@@ -24,7 +24,7 @@
#include "min_allocator.h"
template <class S, class U>
-void test0(S s, U val, S expected, std::size_t expected_erased_count) {
+TEST_CONSTEXPR_CXX26 void test0(S s, U val, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
assert(expected_erased_count == std::erase(s, val));
assert(s == expected);
@@ -32,7 +32,7 @@ void test0(S s, U val, S expected, std::size_t expected_erased_count) {
}
template <class S>
-void test() {
+TEST_CONSTEXPR_CXX26 void test() {
test0(S(), 1, S(), 0);
test0(S({1}), 1, S(), 1);
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 365bd1e88a881..77b2e327858cb 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
@@ -23,7 +23,7 @@
#include "min_allocator.h"
template <class S, class Pred>
-void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
+TEST_CONSTEXPR_CXX26 void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
assert(s == expected);
@@ -31,7 +31,7 @@ void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
}
template <typename S>
-void test() {
+TEST_CONSTEXPR_CXX26 void test() {
auto is1 = [](auto v) { return v == 1; };
auto is2 = [](auto v) { return v == 2; };
auto is3 = [](auto v) { return v == 3; };
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 0a528103cd262..5fc6f835d67ac 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
@@ -34,8 +34,10 @@ TEST_CONSTEXPR_CXX26 bool test() {
test_sequence_append_range_move_only<std::deque>();
test_sequence_append_range_emplace_constructible<std::deque>();
- test_append_range_exception_safety_throwing_copy<std::deque>();
- test_append_range_exception_safety_throwing_allocator<std::deque, int>();
+ if (!TEST_IS_CONSTANT_EVALUATED) {
+ test_append_range_exception_safety_throwing_copy<std::deque>();
+ test_append_range_exception_safety_throwing_allocator<std::deque, int>();
+ }
return true;
}
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 556532a3919ae..09b3d96947f76 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
@@ -32,8 +32,10 @@ TEST_CONSTEXPR_CXX26 bool test() {
});
test_sequence_assign_range_move_only<std::deque>();
- test_assign_range_exception_safety_throwing_copy<std::deque>();
- test_assign_range_exception_safety_throwing_allocator<std::deque, int>();
+ if (!TEST_IS_CONSTANT_EVALUATED) {
+ test_assign_range_exception_safety_throwing_copy<std::deque>();
+ test_assign_range_exception_safety_throwing_allocator<std::deque, int>();
+ }
return true;
}
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 1667d6a80aa72..4d00b215e49b0 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
@@ -22,7 +22,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -41,7 +41,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(int P, C& c1) {
+TEST_CONSTEXPR_CXX26 void test(int P, C& c1) {
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
CI i = c1.emplace(c1.begin() + P, Emplaceable(1, 2.5));
@@ -53,7 +53,7 @@ void test(int P, C& c1) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
for (int i = 0; i <= 3; ++i) {
if (0 <= i && i <= N) {
C c1 = make<C>(N, start);
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 f10363846fbbc..0833ab8199d42 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
@@ -24,7 +24,7 @@
#include "test_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -43,7 +43,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1) {
+TEST_CONSTEXPR_CXX26 void test(C& c1) {
typedef typename C::iterator I;
std::size_t c1_osize = c1.size();
#if TEST_STD_VER > 14
@@ -63,7 +63,7 @@ void test(C& c1) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
C c1 = make<C>(N, start);
test(c1);
}
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 d77535e83a635..0cfa915139f3d 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
@@ -24,7 +24,7 @@
#include "test_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -43,7 +43,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1) {
+TEST_CONSTEXPR_CXX26 void test(C& c1) {
typedef typename C::iterator I;
std::size_t c1_osize = c1.size();
#if TEST_STD_VER > 14
@@ -63,7 +63,7 @@ void test(C& c1) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
C c1 = make<C>(N, start);
test(c1);
}
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 3de0d555f6642..399670d5aafa7 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
@@ -20,7 +20,7 @@
#include "test_macros.h"
template <typename C>
-void del_at_start(C c) {
+TEST_CONSTEXPR_CXX26 void del_at_start(C c) {
typename C::iterator first = c.begin();
typename C::iterator it1 = first + 1;
typename C::iterator it2 = c.end() - 1;
@@ -38,7 +38,7 @@ void del_at_start(C c) {
}
template <typename C>
-void del_at_end(C c) {
+TEST_CONSTEXPR_CXX26 void del_at_end(C c) {
typename C::iterator first = c.end() - 1;
typename C::iterator it1 = c.begin();
typename C::iterator it2 = first - 1;
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 3833a79443596..b03cf6dc6da01 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
@@ -49,7 +49,7 @@ bool Throws::sThrows = false;
#endif
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -68,7 +68,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(int P, C& c1) {
+TEST_CONSTEXPR_CXX26 void test(int P, C& c1) {
typedef typename C::iterator I;
assert(static_cast<std::size_t>(P) < c1.size());
std::size_t c1_osize = c1.size();
@@ -85,7 +85,7 @@ void test(int P, C& c1) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
int pstep = std::max(N / std::max(std::min(N, 10), 1), 1);
for (int p = 0; p < N; p += pstep) {
C c1 = make<C>(N, start);
@@ -115,7 +115,7 @@ TEST_CONSTEXPR_CXX26 bool tests() {
// Test for LWG2953:
// Throws: Nothing unless an exception is thrown by the assignment operator of T.
// (which includes move assignment)
- {
+ if (!TEST_IS_CONSTANT_EVALUATED) {
Throws arr[] = {1, 2, 3};
std::deque<Throws> v(arr, arr + 3);
Throws::sThrows = true;
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 25b194bccf7fe..5f47b0b3cdf35 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
@@ -21,7 +21,7 @@
#include "test_macros.h"
template <typename C>
-void del_at_start(C c, std::size_t num) {
+TEST_CONSTEXPR_CXX26 void del_at_start(C c, std::size_t num) {
typename C::iterator first = c.begin();
typename C::iterator last = first + num;
typename C::iterator it1 = last;
@@ -41,7 +41,7 @@ void del_at_start(C c, std::size_t num) {
}
template <typename C>
-void del_at_end(C c, std::size_t num) {
+TEST_CONSTEXPR_CXX26 void del_at_end(C c, std::size_t num) {
typename C::iterator last = c.end();
typename C::iterator first = last - num;
typename C::iterator it1 = c.begin();
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 3e757935b31af..c61e32f63402f 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
@@ -51,7 +51,7 @@ bool Throws::sThrows = false;
#endif
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -70,7 +70,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(int P, C& c1, int size) {
+TEST_CONSTEXPR_CXX26 void test(int P, C& c1, int size) {
typedef typename C::iterator I;
assert(static_cast<std::size_t>(P + size) <= c1.size());
std::size_t c1_osize = c1.size();
@@ -88,7 +88,7 @@ void test(int P, C& c1, int size) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
int pstep = std::max(N / std::max(std::min(N, 10), 1), 1);
for (int p = 0; p <= N; p += pstep) {
int sstep = std::max((N - p) / std::max(std::min(N - p, 10), 1), 1);
@@ -120,7 +120,7 @@ TEST_CONSTEXPR_CXX26 bool tests() {
// Test for LWG2953:
// Throws: Nothing unless an exception is thrown by the assignment operator of T.
// (which includes move assignment)
- {
+ if (!TEST_IS_CONSTANT_EVALUATED) {
Throws arr[] = {1, 2, 3};
std::deque<Throws> v(arr, arr + 3);
Throws::sThrows = true;
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 7da62fe7082de..ebf7e8e8cf9b2 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
@@ -31,7 +31,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -50,7 +50,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(int P, const C& c0, const C& c2) {
+TEST_CONSTEXPR_CXX26 void test(int P, const C& c0, const C& c2) {
{
typedef typename C::const_iterator CI;
typedef cpp17_input_iterator<CI> BCI;
@@ -107,7 +107,7 @@ void test(int P, const C& c0, const C& c2) {
}
template <class C>
-void testN(int start, int N, int M) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
for (int i = 0; i <= 3; ++i) {
if (0 <= i && i <= N) {
C c1 = make<C>(N, start);
@@ -153,7 +153,7 @@ void testN(int start, int N, int M) {
}
template <class C>
-void testI(int P, C& c1, const C& c2) {
+TEST_CONSTEXPR_CXX26 void testI(int P, C& c1, const C& c2) {
typedef typename C::const_iterator CI;
typedef cpp17_input_iterator<CI> ICI;
std::size_t c1_osize = c1.size();
@@ -173,7 +173,7 @@ void testI(int P, C& c1, const C& c2) {
}
template <class C>
-void testNI(int start, int N, int M) {
+TEST_CONSTEXPR_CXX26 void testNI(int start, int N, int M) {
for (int i = 0; i <= 3; ++i) {
if (0 <= i && i <= N) {
C c1 = make<C>(N, start);
@@ -212,7 +212,7 @@ void testNI(int start, int N, int M) {
}
template <class C>
-void test_move() {
+TEST_CONSTEXPR_CXX26 void test_move() {
#if TEST_STD_VER >= 11
C c;
typedef typename C::const_iterator CI;
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 b818ab5b7a91c..3bb2e451135b6 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
@@ -36,8 +36,10 @@ TEST_CONSTEXPR_CXX26 bool test() {
});
test_sequence_insert_range_move_only<std::deque>();
- test_insert_range_exception_safety_throwing_copy<std::deque>();
- test_insert_range_exception_safety_throwing_allocator<std::deque, int>();
+ if (!TEST_IS_CONSTANT_EVALUATED) {
+ test_insert_range_exception_safety_throwing_copy<std::deque>();
+ test_insert_range_exception_safety_throwing_allocator<std::deque, int>();
+ }
return true;
}
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 8ab016ef2a6c1..35f2a78cd1a7c 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
@@ -22,7 +22,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -41,7 +41,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(int P, C& c1, int x) {
+TEST_CONSTEXPR_CXX26 void test(int P, C& c1, int x) {
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
CI i = c1.insert(c1.begin() + P, MoveOnly(x));
@@ -59,7 +59,7 @@ void test(int P, C& c1, int x) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
for (int i = 0; i <= 3; ++i) {
if (0 <= i && i <= N) {
C c1 = make<C>(N, start);
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 62df9952e1b4e..7e445190b3c54 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
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -40,7 +40,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(int P, C& c1, int size, int x) {
+TEST_CONSTEXPR_CXX26 void test(int P, C& c1, int size, int x) {
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
CI i = c1.insert(c1.begin() + P, size, x);
@@ -58,7 +58,7 @@ void test(int P, C& c1, int size, int x) {
}
template <class C>
-void testN(int start, int N, int M) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
for (int i = 0; i <= 3; ++i) {
if (0 <= i && i <= N) {
C c1 = make<C>(N, start);
@@ -92,7 +92,7 @@ void testN(int start, int N, int M) {
}
template <class C>
-void self_reference_test() {
+TEST_CONSTEXPR_CXX26 void self_reference_test() {
typedef typename C::const_iterator CI;
for (int i = 0; i < 20; ++i) {
for (int j = 0; j < 20; ++j) {
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 e13944e458862..00f8e56d5dfd0 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
@@ -19,7 +19,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -38,7 +38,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(int P, C& c1, int x) {
+TEST_CONSTEXPR_CXX26 void test(int P, C& c1, int x) {
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
CI i = c1.insert(c1.begin() + P, x);
@@ -56,7 +56,7 @@ void test(int P, C& c1, int x) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
for (int i = 0; i <= 3; ++i) {
if (0 <= i && i <= N) {
C c1 = make<C>(N, start);
@@ -78,7 +78,7 @@ void testN(int start, int N) {
}
template <class C>
-void self_reference_test() {
+TEST_CONSTEXPR_CXX26 void self_reference_test() {
typedef typename C::const_iterator CI;
for (int i = 0; i < 20; ++i) {
for (int j = 0; j < 20; ++j) {
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 baa9202524d70..a600c6654767a 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
@@ -20,7 +20,7 @@
#include "test_macros.h"
template <typename C>
-void test(C c) {
+TEST_CONSTEXPR_CXX26 void test(C c) {
typename C::iterator it1 = c.begin();
typename C::iterator it2 = c.end() - 2;
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 bb51057837cb4..3609b50a9d653 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
@@ -19,7 +19,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -38,7 +38,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1) {
+TEST_CONSTEXPR_CXX26 void test(C& c1) {
typedef typename C::iterator I;
std::size_t c1_osize = c1.size();
c1.pop_back();
@@ -51,7 +51,7 @@ void test(C& c1) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
if (N != 0) {
C c1 = make<C>(N, start);
test(c1);
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 35518330040cb..a2895c45790b5 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
@@ -20,7 +20,7 @@
#include "test_macros.h"
template <typename C>
-void test(C c) {
+TEST_CONSTEXPR_CXX26 void test(C c) {
typename C::iterator it1 = c.begin() + 1;
typename C::iterator it2 = c.end() - 1;
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 54226d4c7f331..ed8d6decbc3f7 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
@@ -19,7 +19,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -38,7 +38,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1) {
+TEST_CONSTEXPR_CXX26 void test(C& c1) {
typedef typename C::iterator I;
std::size_t c1_osize = c1.size();
c1.pop_front();
@@ -51,7 +51,7 @@ void test(C& c1) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
if (N != 0) {
C c1 = make<C>(N, start);
test(c1);
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 c16ef7caedc1d..654f197ba45e8 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
@@ -34,8 +34,10 @@ TEST_CONSTEXPR_CXX26 bool test() {
// FIXME: This should work - see https://llvm.org/PR162605
// test_sequence_prepend_range_emplace_constructible<std::deque>();
- test_prepend_range_exception_safety_throwing_copy<std::deque>();
- test_prepend_range_exception_safety_throwing_allocator<std::deque, int>();
+ if (!TEST_IS_CONSTANT_EVALUATED) {
+ test_prepend_range_exception_safety_throwing_copy<std::deque>();
+ test_prepend_range_exception_safety_throwing_allocator<std::deque, int>();
+ }
return true;
}
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 b63f802ee02ad..3a671a6ddf3fb 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
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -39,7 +39,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(int size) {
+TEST_CONSTEXPR_CXX26 void test(int size) {
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[0]);
for (int j = 0; j < N; ++j) {
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 1e12650d6234b..bf9d195f8f406 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
@@ -23,7 +23,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -42,7 +42,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(int size) {
+TEST_CONSTEXPR_CXX26 void test(int size) {
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[0]);
for (int j = 0; j < N; ++j) {
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 50ac046e14453..9dd47359a0e03 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
@@ -19,7 +19,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -38,7 +38,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1, int x) {
+TEST_CONSTEXPR_CXX26 void test(C& c1, int x) {
typedef typename C::iterator I;
std::size_t c1_osize = c1.size();
c1.push_front(x);
@@ -53,7 +53,7 @@ void test(C& c1, int x) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
C c1 = make<C>(N, start);
test(c1, -10);
}
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 24e2bcb5f1c3a..876074f27f7b7 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
@@ -22,7 +22,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -41,7 +41,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void test(C& c1, int x) {
+TEST_CONSTEXPR_CXX26 void test(C& c1, int x) {
typedef typename C::iterator I;
std::size_t c1_osize = c1.size();
c1.push_front(MoveOnly(x));
@@ -56,7 +56,7 @@ void test(C& c1, int x) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
C c1 = make<C>(N, start);
test(c1, -10);
}
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 dc926670de6f7..629ae15a00818 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
@@ -23,7 +23,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -42,7 +42,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
typedef typename C::iterator I;
typedef typename C::const_iterator CI;
typedef random_access_iterator<I> RAI;
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 cc6f6a77e8ed6..94fb2579f25e1 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
@@ -23,7 +23,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -42,7 +42,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
typedef typename C::iterator I;
typedef typename C::const_iterator CI;
typedef random_access_iterator<I> RAI;
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 de4c65c7eba0e..66f73a30ac7f8 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
@@ -23,7 +23,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 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 523a479eef005..44ad5ee453471 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
@@ -23,7 +23,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 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 13a1b8735e0d8..25a37e2cf63c8 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
@@ -19,7 +19,7 @@
#include "min_allocator.h"
template <class C>
-C make(int size, int start = 0) {
+TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
const int b = 4096 / sizeof(int);
int init = 0;
if (start > 0) {
@@ -38,7 +38,7 @@ C make(int size, int start = 0) {
}
template <class C>
-void testN(int start, int N, int M) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
C c1 = make<C>(N, start);
C c2 = make<C>(M);
C c1_save = c1;
>From b5a09871c382b3d3cba3350d44944b4e9eddbe54 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 20:04:32 +0800
Subject: [PATCH 25/41] Fix tests except for constant evaluation step limits
---
.../sequences/deque/deque.cons/alloc.pass.cpp | 2 +-
.../deque/deque.cons/default.pass.cpp | 2 +-
.../deque/deque.cons/iter_iter.pass.cpp | 10 +++++---
.../deque/deque.cons/iter_iter_alloc.pass.cpp | 10 +++++---
.../sequences/deque/deque.cons/size.pass.cpp | 18 ++++++++++-----
.../deque/deque.special/move.pass.cpp | 2 +-
.../deque.special/move_backward.pass.cpp | 2 +-
libcxx/test/support/DefaultOnly.h | 23 +++++++++++++------
8 files changed, 46 insertions(+), 23 deletions(-)
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 64f87d231d180..f8948d767c8d6 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
@@ -38,7 +38,7 @@ TEST_CONSTEXPR_CXX26 bool test() {
test_util<int>(explicit_allocator<int>());
test_util<NotConstructible>(explicit_allocator<NotConstructible>{});
#endif
- return false;
+ return true;
}
int main(int, char**) {
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 cd8e49ecffc34..b1bbb439a016d 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
@@ -44,7 +44,7 @@ TEST_CONSTEXPR_CXX26 bool tests() {
int main(int, char**) {
tests();
#if TEST_STD_VER >= 26
- static_assert(test());
+ static_assert(tests());
#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 e63b6b589bc1c..c67f9d5b9264e 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
@@ -101,12 +101,16 @@ TEST_CONSTEXPR_CXX26 void test_emplacable_concept() {
#endif
}
-int main(int, char**) {
+TEST_CONSTEXPR_CXX26 bool test() {
basic_test();
test_emplacable_concept();
+ return true;
+}
+
+int main(int, char**) {
+ test()
#if TEST_STD_VER >= 26
- static_assert(basic_test());
- static_assert(test_emplacable_concept());
+ static_assert(test());
#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 41b15d56d8cdc..48b64edea405f 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
@@ -97,12 +97,16 @@ TEST_CONSTEXPR_CXX26 void test_emplacable_concept() {
#endif
}
-int main(int, char**) {
+TEST_CONSTEXPR_CXX26 bool test() {
basic_test();
test_emplacable_concept();
+ return true;
+}
+
+int main(int, char**) {
+ test();
#if TEST_STD_VER >= 26
- static_assert(basic_test());
- static_assert(test_emplacable_concept());
+ 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 34e907a7cd166..aa8a6f678653e 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
@@ -25,17 +25,20 @@ TEST_CONSTEXPR_CXX26 void test2(unsigned n) {
#if TEST_STD_VER > 11
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
- assert(DefaultOnly::count == 0);
+ if (!TEST_IS_CONSTANT_EVALUATED)
+ assert(DefaultOnly::count == 0);
{
C d(n, Allocator());
- assert(static_cast<unsigned>(DefaultOnly::count) == n);
+ if (!TEST_IS_CONSTANT_EVALUATED)
+ assert(static_cast<unsigned>(DefaultOnly::count) == n);
assert(d.size() == n);
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d));
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
assert(*i == T());
}
- assert(DefaultOnly::count == 0);
+ if (!TEST_IS_CONSTANT_EVALUATED)
+ assert(DefaultOnly::count == 0);
#else
((void)n);
#endif
@@ -45,10 +48,12 @@ template <class T, class Allocator>
TEST_CONSTEXPR_CXX26 void test1(unsigned n) {
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
- assert(DefaultOnly::count == 0);
+ if (!TEST_IS_CONSTANT_EVALUATED)
+ assert(DefaultOnly::count == 0);
{
C d(n);
- assert(static_cast<unsigned>(DefaultOnly::count) == n);
+ if (!TEST_IS_CONSTANT_EVALUATED)
+ assert(static_cast<unsigned>(DefaultOnly::count) == n);
assert(d.size() == n);
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d));
@@ -57,7 +62,8 @@ TEST_CONSTEXPR_CXX26 void test1(unsigned n) {
assert(*i == T());
#endif
}
- assert(DefaultOnly::count == 0);
+ if (!TEST_IS_CONSTANT_EVALUATED)
+ assert(DefaultOnly::count == 0);
}
template <class T, class Allocator>
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 66f73a30ac7f8..b0486286b7eae 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
@@ -42,7 +42,7 @@ TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
typedef typename C::iterator I;
typedef typename C::const_iterator CI;
typedef random_access_iterator<I> RAI;
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 44ad5ee453471..fb2eafd9a688d 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
@@ -42,7 +42,7 @@ TEST_CONSTEXPR_CXX26 C make(int size, int start = 0) {
}
template <class C>
-void testN(int start, int N) {
+TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
typedef typename C::iterator I;
typedef typename C::const_iterator CI;
typedef random_access_iterator<I> RAI;
diff --git a/libcxx/test/support/DefaultOnly.h b/libcxx/test/support/DefaultOnly.h
index 1c99c4f65630b..30f48f73b16f5 100644
--- a/libcxx/test/support/DefaultOnly.h
+++ b/libcxx/test/support/DefaultOnly.h
@@ -11,6 +11,8 @@
#include <cassert>
+#include "test_macros.h"
+
class DefaultOnly
{
int data_;
@@ -20,13 +22,20 @@ class DefaultOnly
public:
static int count;
- DefaultOnly() : data_(-1) {++count;}
- ~DefaultOnly() {data_ = 0; --count;}
-
- friend bool operator==(const DefaultOnly& x, const DefaultOnly& y)
- {return x.data_ == y.data_;}
- friend bool operator< (const DefaultOnly& x, const DefaultOnly& y)
- {return x.data_ < y.data_;}
+ TEST_CONSTEXPR_CXX20 DefaultOnly() : data_(-1) {
+ if (!TEST_IS_CONSTANT_EVALUATED)
+ ++count;
+ }
+ TEST_CONSTEXPR_CXX20 ~DefaultOnly() {
+ data_ = 0;
+ if (!TEST_IS_CONSTANT_EVALUATED)
+ --count;
+ }
+
+ friend TEST_CONSTEXPR_CXX20 bool operator==(const DefaultOnly& x, const DefaultOnly& y) {
+ return x.data_ == y.data_;
+ }
+ friend TEST_CONSTEXPR_CXX20 bool operator<(const DefaultOnly& x, const DefaultOnly& y) { return x.data_ < y.data_; }
};
int DefaultOnly::count = 0;
>From 4b5a79ec29f1f63c43b74311a73af30953316270 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 20:20:05 +0800
Subject: [PATCH 26/41] Fix copy-pasta
---
.../containers/sequences/deque/deque.cons/iter_iter.pass.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 c67f9d5b9264e..8ec8f71034c02 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
@@ -108,7 +108,7 @@ TEST_CONSTEXPR_CXX26 bool test() {
}
int main(int, char**) {
- test()
+ test();
#if TEST_STD_VER >= 26
static_assert(test());
#endif
>From d848a2ea45cd5bae5fdc695e4ff2916175d272d1 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 21:10:53 +0800
Subject: [PATCH 27/41] Fix-up tests again
---
.../deque/deque.cons/assign_iter_iter.pass.cpp | 13 +++++++++----
libcxx/test/support/DefaultOnly.h | 1 +
2 files changed, 10 insertions(+), 4 deletions(-)
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 e0f57e2aa5b50..f9c4a3210948b 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
@@ -109,7 +109,7 @@ TEST_CONSTEXPR_CXX26 void basic_test() {
}
template <class It>
-void test_emplacable_concept() {
+TEST_CONSTEXPR_CXX26 void test_emplacable_concept() {
#if TEST_STD_VER >= 11
int arr1[] = {42};
int arr2[] = {1, 101, 42};
@@ -131,7 +131,7 @@ void test_emplacable_concept() {
#endif
}
-void test_iterators() {
+TEST_CONSTEXPR_CXX26 void test_iterators() {
test_emplacable_concept<cpp17_input_iterator<int*> >();
test_emplacable_concept<forward_iterator<int*> >();
test_emplacable_concept<bidirectional_iterator<int*> >();
@@ -142,10 +142,15 @@ void test_iterators() {
test_emplacable_concept<int*>();
}
-int main(int, char**) {
+TEST_CONSTEXPR_CXX26 bool test() {
basic_test();
+ test_iterators();
+}
+
+int main(int, char**) {
+ test();
#if TEST_STD_VER >= 26
- static_assert(basic_test());
+ static_assert(test());
#endif
return 0;
}
diff --git a/libcxx/test/support/DefaultOnly.h b/libcxx/test/support/DefaultOnly.h
index 30f48f73b16f5..e12f5eff4b26d 100644
--- a/libcxx/test/support/DefaultOnly.h
+++ b/libcxx/test/support/DefaultOnly.h
@@ -10,6 +10,7 @@
#define DEFAULTONLY_H
#include <cassert>
+#include <type_traits> // std::is_constant_evaluated
#include "test_macros.h"
>From dfb123d9f08430937a668ec48e1f54714fdd37c9 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 21:21:57 +0800
Subject: [PATCH 28/41] `return true;`
---
.../sequences/deque/deque.cons/assign_iter_iter.pass.cpp | 1 +
1 file changed, 1 insertion(+)
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 f9c4a3210948b..47959b1805d38 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
@@ -145,6 +145,7 @@ TEST_CONSTEXPR_CXX26 void test_iterators() {
TEST_CONSTEXPR_CXX26 bool test() {
basic_test();
test_iterators();
+ return true;
}
int main(int, char**) {
>From d176b1078f811b9dd84cf25f2ba42ff122113019 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 22:41:26 +0800
Subject: [PATCH 29/41] Attempt to fix `__split_buffer::emplace_{front,back}`
---
libcxx/include/__split_buffer | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 89c398e525998..d6239ec15440e 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -25,6 +25,7 @@
#include <__memory/compressed_pair.h>
#include <__memory/pointer_traits.h>
#include <__memory/swap_allocator.h>
+#include <__memory/uninitialized_algorithms.h>
#include <__type_traits/conditional.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/integral_constant.h>
@@ -800,7 +801,17 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
difference_type __d = __back_spare();
__d = (__d + 1) / 2;
auto __new_end = __end + __d;
- __set_valid_range(std::move_backward(begin(), __end, __new_end), __new_end);
+ if (__d >= __end_ - __begin_) {
+ auto __new_begin = __begin() + __d;
+ std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __end, __new_begin);
+ __set_valid_range(__new_begin, __new_end);
+ } else {
+ auto __mid = __end - __d;
+ std::__uninitialized_allocator_relocate(__get_allocator(), __mid, __end, __new_end);
+ auto __new_begin = std::move_backward(begin(), __mid, __end);
+ __destruct_at_begin(__new_begin);
+ __set_valid_range(__new_begin, __new_end);
+ }
} else {
size_type __c = std::max<size_type>(2 * capacity(), 1);
__split_buffer<value_type, allocator_type, _Layout> __t(__c, (__c + 3) / 4, __get_allocator());
@@ -821,8 +832,17 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
if (__front_spare() > 0) {
difference_type __d = __front_spare();
__d = (__d + 1) / 2;
- __end = std::move(begin(), __end, begin() - __d);
- __set_valid_range(begin() - __d, __end);
+ auto __new_begin = __begin() - __d;
+ if (__d >= __end_ - __begin_) {
+ std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __end, __new_begin);
+ __set_valid_range(__new_begin, __end - __d);
+ } else {
+ auto __mid = begin() + __d;
+ std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __mid, __new_begin);
+ auto __new_end = std::move(__mid, __end, begin());
+ __destruct_at_end(__new_end);
+ __set_valid_range(__new_begin, __new_end);
+ }
} else {
size_type __c = std::max<size_type>(2 * capacity(), 1);
__split_buffer<value_type, allocator_type, _Layout> __t(__c, __c / 4, __get_allocator());
>From 1eb81558164a1943595d02df1e7bb0ded8b0dd8d Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 22:48:15 +0800
Subject: [PATCH 30/41] Fix conditions
---
libcxx/include/__split_buffer | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index d6239ec15440e..3d9a4c0524e0e 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -801,7 +801,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
difference_type __d = __back_spare();
__d = (__d + 1) / 2;
auto __new_end = __end + __d;
- if (__d >= __end_ - __begin_) {
+ if (static_cast<size_type>(__d) >= size()) {
auto __new_begin = __begin() + __d;
std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __end, __new_begin);
__set_valid_range(__new_begin, __new_end);
@@ -833,7 +833,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
difference_type __d = __front_spare();
__d = (__d + 1) / 2;
auto __new_begin = __begin() - __d;
- if (__d >= __end_ - __begin_) {
+ if (static_cast<size_type>(__d) >= size()) {
std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __end, __new_begin);
__set_valid_range(__new_begin, __end - __d);
} else {
>From 9cd76118b9c06a41a79b13e37f19ef245bfcaf8f Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 10 Mar 2026 23:02:39 +0800
Subject: [PATCH 31/41] Fix copy-pasta again
---
libcxx/include/__split_buffer | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 3d9a4c0524e0e..3f1490920e4c1 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -802,7 +802,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
__d = (__d + 1) / 2;
auto __new_end = __end + __d;
if (static_cast<size_type>(__d) >= size()) {
- auto __new_begin = __begin() + __d;
+ auto __new_begin = begin() + __d;
std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __end, __new_begin);
__set_valid_range(__new_begin, __new_end);
} else {
@@ -832,7 +832,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
if (__front_spare() > 0) {
difference_type __d = __front_spare();
__d = (__d + 1) / 2;
- auto __new_begin = __begin() - __d;
+ auto __new_begin = begin() - __d;
if (static_cast<size_type>(__d) >= size()) {
std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __end, __new_begin);
__set_valid_range(__new_begin, __end - __d);
>From 90218a1e0f82e757fb17cfa96cde1cbca5772121 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 11 Mar 2026 09:14:34 +0800
Subject: [PATCH 32/41] Turn fancy pointers into raw pointers
(`std::__to_address`)
---
libcxx/include/__split_buffer | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 3f1490920e4c1..d2a30b3da46ae 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -803,11 +803,13 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
auto __new_end = __end + __d;
if (static_cast<size_type>(__d) >= size()) {
auto __new_begin = begin() + __d;
- std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __end, __new_begin);
+ std::__uninitialized_allocator_relocate(
+ __get_allocator(), std::__to_address(begin()), std::__to_address(__end), std::__to_address(__new_begin));
__set_valid_range(__new_begin, __new_end);
} else {
auto __mid = __end - __d;
- std::__uninitialized_allocator_relocate(__get_allocator(), __mid, __end, __new_end);
+ std::__uninitialized_allocator_relocate(
+ __get_allocator(), std::__to_address(__mid), std::__to_address(__end), std::__to_address(__new_end));
auto __new_begin = std::move_backward(begin(), __mid, __end);
__destruct_at_begin(__new_begin);
__set_valid_range(__new_begin, __new_end);
@@ -834,11 +836,13 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
__d = (__d + 1) / 2;
auto __new_begin = begin() - __d;
if (static_cast<size_type>(__d) >= size()) {
- std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __end, __new_begin);
+ std::__uninitialized_allocator_relocate(
+ __get_allocator(), std::__to_address(begin()), std::__to_address(__end), std::__to_address(__new_begin));
__set_valid_range(__new_begin, __end - __d);
} else {
auto __mid = begin() + __d;
- std::__uninitialized_allocator_relocate(__get_allocator(), begin(), __mid, __new_begin);
+ std::__uninitialized_allocator_relocate(
+ __get_allocator(), std::__to_address(begin()), std::__to_address(__mid), std::__to_address(__new_begin));
auto __new_end = std::move(__mid, __end, begin());
__destruct_at_end(__new_end);
__set_valid_range(__new_begin, __new_end);
>From 583a08256f734c7eb543530547111ed6dda42c73 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 11 Mar 2026 10:43:06 +0800
Subject: [PATCH 33/41] Fix probably misused reallocation
---
libcxx/include/__split_buffer | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index d2a30b3da46ae..3a802e513981f 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -808,8 +808,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
__set_valid_range(__new_begin, __new_end);
} else {
auto __mid = __end - __d;
- std::__uninitialized_allocator_relocate(
- __get_allocator(), std::__to_address(__mid), std::__to_address(__end), std::__to_address(__new_end));
+ std::__uninitialized_allocator_copy(
+ __get_allocator(), move_iterator<pointer>(__mid), move_iterator<pointer>(__end), __end);
auto __new_begin = std::move_backward(begin(), __mid, __end);
__destruct_at_begin(__new_begin);
__set_valid_range(__new_begin, __new_end);
@@ -841,8 +841,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
__set_valid_range(__new_begin, __end - __d);
} else {
auto __mid = begin() + __d;
- std::__uninitialized_allocator_relocate(
- __get_allocator(), std::__to_address(begin()), std::__to_address(__mid), std::__to_address(__new_begin));
+ std::__uninitialized_allocator_copy(
+ __get_allocator(), move_iterator<pointer>(begin()), move_iterator<pointer>(__mid), __new_begin);
auto __new_end = std::move(__mid, __end, begin());
__destruct_at_end(__new_end);
__set_valid_range(__new_begin, __new_end);
>From e9dae875697e1a376516304dd3477a22331f5dc0 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 11 Mar 2026 14:12:57 +0800
Subject: [PATCH 34/41] Fix-up construction and destruction at end
---
libcxx/include/__split_buffer | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 3a802e513981f..fb7f2402e27d3 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -23,6 +23,7 @@
#include <__memory/allocator.h>
#include <__memory/allocator_traits.h>
#include <__memory/compressed_pair.h>
+#include <__memory/destroy.h>
#include <__memory/pointer_traits.h>
#include <__memory/swap_allocator.h>
#include <__memory/uninitialized_algorithms.h>
@@ -811,7 +812,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
std::__uninitialized_allocator_copy(
__get_allocator(), move_iterator<pointer>(__mid), move_iterator<pointer>(__end), __end);
auto __new_begin = std::move_backward(begin(), __mid, __end);
- __destruct_at_begin(__new_begin);
+ std::__allocator_destroy(__get_allocator(), begin(), __new_begin);
__set_valid_range(__new_begin, __new_end);
}
} else {
@@ -838,14 +839,16 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
if (static_cast<size_type>(__d) >= size()) {
std::__uninitialized_allocator_relocate(
__get_allocator(), std::__to_address(begin()), std::__to_address(__end), std::__to_address(__new_begin));
- __set_valid_range(__new_begin, __end - __d);
+ __end -= __d;
+ __set_valid_range(__new_begin, __end);
} else {
auto __mid = begin() + __d;
std::__uninitialized_allocator_copy(
__get_allocator(), move_iterator<pointer>(begin()), move_iterator<pointer>(__mid), __new_begin);
auto __new_end = std::move(__mid, __end, begin());
- __destruct_at_end(__new_end);
- __set_valid_range(__new_begin, __new_end);
+ std::__allocator_destroy(__get_allocator(), __new_end, __end);
+ __end = __new_end;
+ __set_valid_range(__new_begin, __end);
}
} else {
size_type __c = std::max<size_type>(2 * capacity(), 1);
>From a8ce8e85daa43cd22c4ef61ac83b6969e4a858c2 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 11 Mar 2026 17:17:05 +0800
Subject: [PATCH 35/41] Bump constant evaluation step limits!
---
.../sequences/deque/deque.capacity/resize_size.pass.cpp | 3 +++
.../sequences/deque/deque.capacity/resize_size_value.pass.cpp | 3 +++
.../sequences/deque/deque.capacity/shrink_to_fit.pass.cpp | 3 +++
.../sequences/deque/deque.cons/assign_iter_iter.pass.cpp | 3 +++
.../sequences/deque/deque.cons/assign_size_value.pass.cpp | 3 +++
.../std/containers/sequences/deque/deque.cons/size.pass.cpp | 2 ++
.../containers/sequences/deque/deque.cons/size_value.pass.cpp | 2 ++
.../sequences/deque/deque.cons/size_value_alloc.pass.cpp | 2 ++
.../sequences/deque/deque.modifiers/emplace.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/emplace_back.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/emplace_front.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/erase_iter.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp | 2 ++
.../sequences/deque/deque.modifiers/insert_range.pass.cpp | 2 ++
.../sequences/deque/deque.modifiers/insert_rvalue.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/insert_size_value.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/insert_value.pass.cpp | 3 +++
.../deque/deque.modifiers/pop_back.invalidation.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/pop_back.pass.cpp | 3 +++
.../deque/deque.modifiers/pop_front.invalidation.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/pop_front.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/push_back.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/push_front.pass.cpp | 3 +++
.../sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp | 3 +++
.../std/containers/sequences/deque/deque.special/copy.pass.cpp | 3 +++
.../sequences/deque/deque.special/copy_backward.pass.cpp | 3 +++
.../std/containers/sequences/deque/deque.special/move.pass.cpp | 3 +++
.../sequences/deque/deque.special/move_backward.pass.cpp | 3 +++
.../std/containers/sequences/deque/deque.special/swap.pass.cpp | 3 +++
31 files changed, 88 insertions(+)
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 8961110d67311..b6b07480bf416 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void resize(size_type n);
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 97f83fbabd1a6..0cafe6e9bd36d 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void resize(size_type n, const value_type& v);
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 ac7a969810ec1..234a5a7ce603c 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void shrink_to_fit();
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 47959b1805d38..c654e44d5c862 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// template <class InputIterator>
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 59ef7d4e6c4aa..88ed084659d81 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void assign(size_type n, const value_type& v);
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 aa8a6f678653e..ed6a20ae13fba 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
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=33554432
+
// <deque>
// explicit deque(size_type n);
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 d44637ec93bde..ecbec908b4888 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
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=33554432
+
// <deque>
// deque(size_type n, const value_type& v);
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 9ceb911f374d2..ab7fa24d6a89a 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
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=33554432
+
// <deque>
// deque(size_type n, const value_type& v, const allocator_type& a);
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 4d00b215e49b0..6946db898574e 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
@@ -12,6 +12,9 @@
// UNSUPPORTED: c++03
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
#include "asan_testing.h"
#include <deque>
#include <cassert>
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 0833ab8199d42..68ae902ea3bda 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
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// template <class... Args> reference emplace_back(Args&&... args);
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 0cfa915139f3d..69afd11f4e417 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
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// template <class... Args> reference emplace_front(Args&&... args);
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 b03cf6dc6da01..54efdba85d54a 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// iterator erase(const_iterator p)
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 c61e32f63402f..bdb7d8c087ff1 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
@@ -8,6 +8,9 @@
//
// REQUIRES: long_tests
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// iterator erase(const_iterator f, const_iterator l)
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 ebf7e8e8cf9b2..92c3c4d8317e7 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
@@ -14,6 +14,8 @@
// ADDITIONAL_COMPILE_FLAGS(msan): -O1
// ADDITIONAL_COMPILE_FLAGS(tsan): -O1
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=33554432
+
// <deque>
// template <class InputIterator>
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 3bb2e451135b6..d110a6256029d 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
@@ -13,6 +13,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=33554432
+
// template<container-compatible-range<T> R>
// constexpr iterator insert_range(const_iterator position, R&& rg); // C++23
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 35f2a78cd1a7c..e4df5c8c91e30 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
@@ -12,6 +12,9 @@
// UNSUPPORTED: c++03
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
#include "asan_testing.h"
#include <deque>
#include <cassert>
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 7e445190b3c54..f731becd16f43 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
@@ -8,6 +8,9 @@
//
// REQUIRES: long_tests
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// iterator insert (const_iterator p, size_type n, const value_type& v);
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 00f8e56d5dfd0..6f8da7044bad9 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// iterator insert (const_iterator p, const value_type& v);
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 a600c6654767a..9ad251a4d2603 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void pop_back()
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 3609b50a9d653..e75b3f8dc116f 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void pop_back()
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 a2895c45790b5..97f7f8a562bdf 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void pop_front()
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 ed8d6decbc3f7..d6505b68a568b 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void pop_front()
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 3a671a6ddf3fb..f2a2baefb3f40 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void push_back(const value_type& v);
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 bf9d195f8f406..7fb678e0cb4f3 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
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void push_back(value_type&& v);
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 9dd47359a0e03..a10cbb2fb5090 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void push_front(const value_type& v);
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 876074f27f7b7..af1c529afc5df 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
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// void push_front(value_type&& v);
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 629ae15a00818..a4f8cd57f30ca 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// Optimization for deque::iterators
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 94fb2579f25e1..3b502847172a0 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// Optimization for deque::iterators
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 b0486286b7eae..c1df1f0e09bdb 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// Optimization for deque::iterators
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 fb2eafd9a688d..625691438bccf 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// Optimization for deque::iterators
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 25a37e2cf63c8..594a756c26c3a 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+
// <deque>
// template <class T, class A>
>From 047faa6be4234ee39f75bdd969c7abbc2df651c4 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 11 Mar 2026 18:10:53 +0800
Subject: [PATCH 36/41] constexpr-friendlily detect whether
`__is_pointer_in_range`
---
libcxx/include/deque | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 497819b492ecf..f9e74c786d292 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -234,6 +234,7 @@ template <class T, class Allocator, class Predicate>
# include <__type_traits/type_identity.h>
# include <__utility/exception_guard.h>
# include <__utility/forward.h>
+# include <__utility/is_pointer_in_range.h>
# include <__utility/move.h>
# include <__utility/pair.h>
# include <__utility/swap.h>
@@ -2368,7 +2369,7 @@ deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __
__bs = __n;
__fe = __fb + __bs;
}
- if (__fb <= __vt && __vt < __fe)
+ if (std::__is_pointer_in_range(std::__to_address(__fb), std::__to_address(__fe), std::__to_address(__vt)))
__vt = (const_iterator(__f.__m_iter_, __vt) -= __f - __r).__ptr_;
__r = std::move(__fb, __fe, __r);
__n -= __bs;
@@ -2395,7 +2396,7 @@ deque<_Tp, _Allocator>::__move_backward_and_check(iterator __f, iterator __l, it
__bs = __n;
__lb = __le - __bs;
}
- if (__lb <= __vt && __vt < __le)
+ if (std::__is_pointer_in_range(std::__to_address(__lb), std::__to_address(__le), std::__to_address(__vt)))
__vt = (const_iterator(__l.__m_iter_, __vt) += __r - __l - 1).__ptr_;
__r = std::move_backward(__lb, __le, __r);
__n -= __bs;
@@ -2422,7 +2423,7 @@ deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator __l, i
__bs = __n;
__fe = __fb + __bs;
}
- if (__fb <= __vt && __vt < __fe)
+ if (std::__is_pointer_in_range(std::__to_address(__fb), std::__to_address(__fe), std::__to_address(__vt)))
__vt = (const_iterator(__f.__m_iter_, __vt) += __r - __f).__ptr_;
for (; __fb != __fe; ++__fb, ++__r, ++__size())
__alloc_traits::construct(__a, std::addressof(*__r), std::move(*__fb));
@@ -2454,7 +2455,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void deque<_Tp, _Allocator>::__move_construct_back
__bs = __n;
__lb = __le - __bs;
}
- if (__lb <= __vt && __vt < __le)
+ if (std::__is_pointer_in_range(std::__to_address(__lb), std::__to_address(__le), std::__to_address(__vt)))
__vt = (const_iterator(__l.__m_iter_, __vt) -= __l - __r + 1).__ptr_;
while (__le != __lb) {
__alloc_traits::construct(__a, std::addressof(*--__r), std::move(*--__le));
>From 1104717cc65d264b2ca136b48c982eea7fc2a9ba Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 11 Mar 2026 18:12:16 +0800
Subject: [PATCH 37/41] Crazily bump constant evaluation step limits
---
.../sequences/deque/deque.capacity/resize_size.pass.cpp | 4 ++--
.../sequences/deque/deque.capacity/resize_size_value.pass.cpp | 4 ++--
.../sequences/deque/deque.capacity/shrink_to_fit.pass.cpp | 4 ++--
.../sequences/deque/deque.cons/assign_iter_iter.pass.cpp | 4 ++--
.../sequences/deque/deque.cons/assign_size_value.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/emplace.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/emplace_front.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/erase_iter.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/insert_rvalue.pass.cpp | 4 ++--
.../deque/deque.modifiers/insert_size_value.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/insert_value.pass.cpp | 4 ++--
.../deque/deque.modifiers/pop_back.invalidation.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/pop_back.pass.cpp | 4 ++--
.../deque/deque.modifiers/pop_front.invalidation.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/pop_front.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/push_back.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/push_front.pass.cpp | 4 ++--
.../deque/deque.modifiers/push_front_rvalue.pass.cpp | 4 ++--
.../containers/sequences/deque/deque.special/copy.pass.cpp | 4 ++--
.../sequences/deque/deque.special/copy_backward.pass.cpp | 4 ++--
.../containers/sequences/deque/deque.special/move.pass.cpp | 4 ++--
.../sequences/deque/deque.special/move_backward.pass.cpp | 4 ++--
.../containers/sequences/deque/deque.special/swap.pass.cpp | 4 ++--
25 files changed, 50 insertions(+), 50 deletions(-)
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 b6b07480bf416..9215096a1d04d 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 0cafe6e9bd36d..4f7f478af34fa 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 234a5a7ce603c..19f1d40496212 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 c654e44d5c862..d37a689e15ce1 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=450000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=450000000
// <deque>
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 88ed084659d81..ba36599f7bb95 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 6946db898574e..877173115b330 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
@@ -12,8 +12,8 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
#include "asan_testing.h"
#include <deque>
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 69afd11f4e417..1c874ebbc0afa 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
@@ -8,8 +8,8 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 54efdba85d54a..41dfdc9209833 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 bdb7d8c087ff1..fd508422b1928 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
@@ -8,8 +8,8 @@
//
// REQUIRES: long_tests
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 e4df5c8c91e30..be273959341e9 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
@@ -12,8 +12,8 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
#include "asan_testing.h"
#include <deque>
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 f731becd16f43..ecae3f30844f3 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
@@ -8,8 +8,8 @@
//
// REQUIRES: long_tests
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 6f8da7044bad9..a4d485fb15baa 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 9ad251a4d2603..8ab78ef836504 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 e75b3f8dc116f..f68d7f803dfc4 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 97f7f8a562bdf..64c66c56bdc51 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 d6505b68a568b..103b230819726 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 f2a2baefb3f40..e01465e38bbb1 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 7fb678e0cb4f3..238c19e5c82c8 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
@@ -8,8 +8,8 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 a10cbb2fb5090..a38bb8d336ef8 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 af1c529afc5df..c7f948c86043b 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
@@ -8,8 +8,8 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 a4f8cd57f30ca..50973f7ffcb4d 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 3b502847172a0..744e26de03346 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 c1df1f0e09bdb..546b695e3090f 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 625691438bccf..b16d395a5cbe0 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
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 594a756c26c3a..c8853eb58015b 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
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
// <deque>
>From e900b60a44e942eef43121575d7808f04468b506 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 18 Mar 2026 15:33:49 +0800
Subject: [PATCH 38/41] Reduce constant-evaluated cases
---
.../deque/deque.capacity/resize_size.pass.cpp | 22 +++++-
.../deque.capacity/resize_size_value.pass.cpp | 22 +++++-
.../deque.capacity/shrink_to_fit.pass.cpp | 19 +++++-
.../deque.cons/assign_iter_iter.pass.cpp | 24 ++++++-
.../deque.cons/assign_size_value.pass.cpp | 21 +++++-
.../sequences/deque/deque.cons/size.pass.cpp | 35 ++++++----
.../deque/deque.cons/size_value.pass.cpp | 36 ++++++----
.../deque.cons/size_value_alloc.pass.cpp | 68 ++++++++++++-------
.../deque/deque.modifiers/emplace.pass.cpp | 19 +++++-
.../deque.modifiers/emplace_back.pass.cpp | 42 ++++++++----
.../deque.modifiers/emplace_front.pass.cpp | 42 ++++++++----
.../deque/deque.modifiers/erase_iter.pass.cpp | 18 ++++-
.../deque.modifiers/erase_iter_iter.pass.cpp | 18 ++++-
.../deque.modifiers/insert_iter_iter.pass.cpp | 30 +++++++-
.../deque.modifiers/insert_rvalue.pass.cpp | 19 +++++-
.../insert_size_value.pass.cpp | 26 ++++++-
.../deque.modifiers/insert_value.pass.cpp | 22 +++++-
.../pop_back.invalidation.pass.cpp | 16 +++--
.../deque/deque.modifiers/pop_back.pass.cpp | 21 +++++-
.../pop_front.invalidation.pass.cpp | 16 +++--
.../deque/deque.modifiers/pop_front.pass.cpp | 18 ++++-
.../deque/deque.modifiers/push_back.pass.cpp | 14 +++-
.../deque.modifiers/push_back_rvalue.pass.cpp | 15 +++-
.../deque/deque.modifiers/push_front.pass.cpp | 19 +++++-
.../push_front_rvalue.pass.cpp | 18 ++++-
.../deque/deque.special/copy.pass.cpp | 19 +++++-
.../deque.special/copy_backward.pass.cpp | 18 ++++-
.../deque/deque.special/move.pass.cpp | 18 ++++-
.../deque.special/move_backward.pass.cpp | 18 ++++-
.../deque/deque.special/swap.pass.cpp | 27 +++++++-
30 files changed, 560 insertions(+), 160 deletions(-)
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 9215096a1d04d..e63e2101c9694 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void resize(size_type n);
@@ -67,6 +64,25 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
}
TEST_CONSTEXPR_CXX26 bool test() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+ constexpr int ks[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ for (int k : ks) {
+ testN<std::deque<int>>(i, j, k);
+ testN<std::deque<int, min_allocator<int>>>(i, j, k);
+ testN<std::deque<int, safe_allocator<int>>>(i, j, k);
+ }
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 4f7f478af34fa..25c4118ee0781 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void resize(size_type n, const value_type& v);
@@ -67,6 +64,25 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
}
TEST_CONSTEXPR_CXX26 bool test() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+ constexpr int ks[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ for (int k : ks) {
+ testN<std::deque<int>>(i, j, k);
+ testN<std::deque<int, min_allocator<int>>>(i, j, k);
+ testN<std::deque<int, safe_allocator<int>>>(i, j, k);
+ }
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 19f1d40496212..5ad8bb5189690 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void shrink_to_fit();
@@ -54,6 +51,22 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool test() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ testN<std::deque<int, safe_allocator<int>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 d37a689e15ce1..62137146bd911 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=450000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=450000000
-
// <deque>
// template <class InputIterator>
@@ -80,6 +77,27 @@ TEST_CONSTEXPR_CXX26 void testNI(int start, int N, int M) {
}
TEST_CONSTEXPR_CXX26 void basic_test() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+ constexpr int ks[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ for (int k : ks) {
+ testN<std::deque<int>>(i, j, k);
+ testN<std::deque<int, min_allocator<int>>>(i, j, k);
+ testN<std::deque<int, safe_allocator<int>>>(i, j, k);
+ }
+ }
+ }
+
+ testNI<std::deque<int>>(1500, 2000, 1000);
+ testNI<std::deque<int, min_allocator<int>>>(1500, 2000, 1000);
+ testNI<std::deque<int, safe_allocator<int>>>(1500, 2000, 1000);
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 ba36599f7bb95..793203343157e 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void assign(size_type n, const value_type& v);
@@ -59,6 +56,24 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
}
TEST_CONSTEXPR_CXX26 bool test() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+ constexpr int ks[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ for (int k : ks) {
+ testN<std::deque<int>>(i, j, k);
+ testN<std::deque<int, min_allocator<int>>>(i, j, k);
+ }
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 ed6a20ae13fba..e9a2d55c22d61 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
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=33554432
-
// <deque>
// explicit deque(size_type n);
@@ -91,18 +89,27 @@ TEST_CONSTEXPR_CXX26 void test(unsigned n) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
- test<DefaultOnly, std::allocator<DefaultOnly> >(0);
- test<DefaultOnly, std::allocator<DefaultOnly> >(1);
- test<DefaultOnly, std::allocator<DefaultOnly> >(10);
- test<DefaultOnly, std::allocator<DefaultOnly> >(1023);
- test<DefaultOnly, std::allocator<DefaultOnly> >(1024);
- test<DefaultOnly, std::allocator<DefaultOnly> >(1025);
- test<DefaultOnly, std::allocator<DefaultOnly> >(2047);
- test<DefaultOnly, std::allocator<DefaultOnly> >(2048);
- test<DefaultOnly, std::allocator<DefaultOnly> >(2049);
- test<DefaultOnly, std::allocator<DefaultOnly> >(4095);
- test<DefaultOnly, std::allocator<DefaultOnly> >(4096);
- test<DefaultOnly, std::allocator<DefaultOnly> >(4097);
+#if TEST_STD_VER >= 26
+ if consteval {
+ test<DefaultOnly, std::allocator<DefaultOnly>>(0);
+ test<DefaultOnly, std::allocator<DefaultOnly>>(2049);
+ test<DefaultOnly, std::allocator<DefaultOnly>>(4097);
+ } else
+#endif
+ {
+ test<DefaultOnly, std::allocator<DefaultOnly> >(0);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(1);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(10);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(1023);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(1024);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(1025);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(2047);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(2048);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(2049);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(4095);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(4096);
+ test<DefaultOnly, std::allocator<DefaultOnly> >(4097);
+ }
LIBCPP_ONLY(test1<DefaultOnly, limited_allocator<DefaultOnly, 4096> >(4095));
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 ecbec908b4888..611899d714328 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
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=33554432
-
// <deque>
// deque(size_type n, const value_type& v);
@@ -34,18 +32,28 @@ TEST_CONSTEXPR_CXX26 void test(unsigned n, const T& x) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
- test<int, std::allocator<int> >(0, 5);
- test<int, std::allocator<int> >(1, 10);
- test<int, std::allocator<int> >(10, 11);
- test<int, std::allocator<int> >(1023, -11);
- test<int, std::allocator<int> >(1024, 25);
- test<int, std::allocator<int> >(1025, 0);
- test<int, std::allocator<int> >(2047, 110);
- test<int, std::allocator<int> >(2048, -500);
- test<int, std::allocator<int> >(2049, 654);
- test<int, std::allocator<int> >(4095, 78);
- test<int, std::allocator<int> >(4096, 1165);
- test<int, std::allocator<int> >(4097, 157);
+#if TEST_STD_VER >= 26
+ if consteval {
+ test<int, std::allocator<int> >(0, 5);
+ test<int, std::allocator<int> >(2049, 654);
+ test<int, std::allocator<int> >(4097, 157);
+ } else
+#endif
+ {
+ test<int, std::allocator<int> >(0, 5);
+ test<int, std::allocator<int> >(1, 10);
+ test<int, std::allocator<int> >(10, 11);
+ test<int, std::allocator<int> >(1023, -11);
+ test<int, std::allocator<int> >(1024, 25);
+ test<int, std::allocator<int> >(1025, 0);
+ test<int, std::allocator<int> >(2047, 110);
+ test<int, std::allocator<int> >(2048, -500);
+ test<int, std::allocator<int> >(2049, 654);
+ test<int, std::allocator<int> >(4095, 78);
+ test<int, std::allocator<int> >(4096, 1165);
+ test<int, std::allocator<int> >(4097, 157);
+ }
+
LIBCPP_ONLY(test<int, limited_allocator<int, 4096> >(4095, 90));
#if TEST_STD_VER >= 11
test<int, min_allocator<int> >(4095, 90);
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 ab7fa24d6a89a..89a2ab29803dd 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
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=33554432
-
// <deque>
// deque(size_type n, const value_type& v, const allocator_type& a);
@@ -36,34 +34,52 @@ TEST_CONSTEXPR_CXX26 void test(unsigned n, const T& x, const Allocator& a) {
TEST_CONSTEXPR_CXX26 bool tests() {
{
std::allocator<int> a;
- test(0, 5, a);
- test(1, 10, a);
- test(10, 11, a);
- test(1023, -11, a);
- test(1024, 25, a);
- test(1025, 0, a);
- test(2047, 110, a);
- test(2048, -500, a);
- test(2049, 654, a);
- test(4095, 78, a);
- test(4096, 1165, a);
- test(4097, 157, a);
+#if TEST_STD_VER >= 26
+ if consteval {
+ test(0, 5, a);
+ test(2049, 654, a);
+ test(4097, 157, a);
+ } else
+#endif
+ {
+ test(0, 5, a);
+ test(1, 10, a);
+ test(10, 11, a);
+ test(1023, -11, a);
+ test(1024, 25, a);
+ test(1025, 0, a);
+ test(2047, 110, a);
+ test(2048, -500, a);
+ test(2049, 654, a);
+ test(4095, 78, a);
+ test(4096, 1165, a);
+ test(4097, 157, a);
+ }
}
#if TEST_STD_VER >= 11
{
min_allocator<int> a;
- test(0, 5, a);
- test(1, 10, a);
- test(10, 11, a);
- test(1023, -11, a);
- test(1024, 25, a);
- test(1025, 0, a);
- test(2047, 110, a);
- test(2048, -500, a);
- test(2049, 654, a);
- test(4095, 78, a);
- test(4096, 1165, a);
- test(4097, 157, a);
+# if TEST_STD_VER >= 26
+ if consteval {
+ test(0, 5, a);
+ test(2049, 654, a);
+ test(4097, 157, a);
+ } else
+# endif
+ {
+ test(0, 5, a);
+ test(1, 10, a);
+ test(10, 11, a);
+ test(1023, -11, a);
+ test(1024, 25, a);
+ test(1025, 0, a);
+ test(2047, 110, a);
+ test(2048, -500, a);
+ test(2049, 654, a);
+ test(4095, 78, a);
+ test(4096, 1165, a);
+ test(4097, 157, a);
+ }
}
#endif
return true;
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 877173115b330..f30132f890d4f 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
@@ -12,9 +12,6 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
#include "asan_testing.h"
#include <deque>
#include <cassert>
@@ -78,6 +75,22 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<Emplaceable>>(i, j);
+ testN<std::deque<Emplaceable, min_allocator<Emplaceable>>>(i, j);
+ testN<std::deque<Emplaceable, safe_allocator<Emplaceable>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 68ae902ea3bda..9a4e4b7940f43 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
@@ -8,9 +8,6 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=200000000
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=200000000
-
// <deque>
// template <class... Args> reference emplace_back(Args&&... args);
@@ -72,19 +69,34 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<Emplaceable>>(is, js);
+ testN<std::deque<Emplaceable, min_allocator<Emplaceable>>>(i, j);
+ }
+ }
+ } else
+#endif
{
- int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
- const int N = sizeof(rng) / sizeof(rng[0]);
- for (int i = 0; i < N; ++i)
- for (int j = 0; j < N; ++j)
- testN<std::deque<Emplaceable> >(rng[i], rng[j]);
- }
- {
- int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
- const int N = sizeof(rng) / sizeof(rng[0]);
- for (int i = 0; i < N; ++i)
- for (int j = 0; j < N; ++j)
- testN<std::deque<Emplaceable, min_allocator<Emplaceable>> >(rng[i], rng[j]);
+ {
+ int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
+ const int N = sizeof(rng) / sizeof(rng[0]);
+ for (int i = 0; i < N; ++i)
+ for (int j = 0; j < N; ++j)
+ testN<std::deque<Emplaceable> >(rng[i], rng[j]);
+ }
+ {
+ int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
+ const int N = sizeof(rng) / sizeof(rng[0]);
+ for (int i = 0; i < N; ++i)
+ for (int j = 0; j < N; ++j)
+ testN<std::deque<Emplaceable, min_allocator<Emplaceable>> >(rng[i], rng[j]);
+ }
}
{
std::deque<Tag_X, TaggingAllocator<Tag_X>> c;
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 1c874ebbc0afa..5e430c317fac2 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
@@ -8,9 +8,6 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// template <class... Args> reference emplace_front(Args&&... args);
@@ -72,19 +69,34 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<Emplaceable>>(is, js);
+ testN<std::deque<Emplaceable, min_allocator<Emplaceable>>>(i, j);
+ }
+ }
+ } else
+#endif
{
- int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
- const int N = sizeof(rng) / sizeof(rng[0]);
- for (int i = 0; i < N; ++i)
- for (int j = 0; j < N; ++j)
- testN<std::deque<Emplaceable> >(rng[i], rng[j]);
- }
- {
- int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
- const int N = sizeof(rng) / sizeof(rng[0]);
- for (int i = 0; i < N; ++i)
- for (int j = 0; j < N; ++j)
- testN<std::deque<Emplaceable, min_allocator<Emplaceable>> >(rng[i], rng[j]);
+ {
+ int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
+ const int N = sizeof(rng) / sizeof(rng[0]);
+ for (int i = 0; i < N; ++i)
+ for (int j = 0; j < N; ++j)
+ testN<std::deque<Emplaceable> >(rng[i], rng[j]);
+ }
+ {
+ int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
+ const int N = sizeof(rng) / sizeof(rng[0]);
+ for (int i = 0; i < N; ++i)
+ for (int j = 0; j < N; ++j)
+ testN<std::deque<Emplaceable, min_allocator<Emplaceable>> >(rng[i], rng[j]);
+ }
}
{
std::deque<Tag_X, TaggingAllocator<Tag_X>> c;
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 41dfdc9209833..3b6b17419f3f0 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// iterator erase(const_iterator p)
@@ -97,6 +94,21 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 fd508422b1928..7174daf98117c 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
@@ -8,9 +8,6 @@
//
// REQUIRES: long_tests
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// iterator erase(const_iterator f, const_iterator l)
@@ -103,6 +100,21 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 92c3c4d8317e7..b827603a73911 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
@@ -14,8 +14,6 @@
// ADDITIONAL_COMPILE_FLAGS(msan): -O1
// ADDITIONAL_COMPILE_FLAGS(tsan): -O1
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=33554432
-
// <deque>
// template <class InputIterator>
@@ -238,6 +236,34 @@ TEST_CONSTEXPR_CXX26 void test_move() {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+ constexpr int ks[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ for (int k : ks) {
+ testN<std::deque<int>>(i, j, k);
+ testN<std::deque<int, min_allocator<int>>>(i, j, k);
+ testN<std::deque<int, safe_allocator<int>>>(i, j, k);
+ }
+ }
+ }
+
+ testNI<std::deque<int>>(1500, 2000, 1000);
+ testNI<std::deque<int, min_allocator<int>>>(1500, 2000, 1000);
+ testNI<std::deque<int, safe_allocator<int>>>(1500, 2000, 1000);
+
+ test_move<std::deque<MoveOnly>>();
+ test_move<std::deque<MoveOnly, limited_allocator<MoveOnly, 2000>>>();
+ test_move<std::deque<MoveOnly, min_allocator<MoveOnly>>>();
+ test_move<std::deque<MoveOnly, safe_allocator<MoveOnly>>>();
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 be273959341e9..cd3cded63cd48 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
@@ -12,9 +12,6 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
#include "asan_testing.h"
#include <deque>
#include <cassert>
@@ -84,6 +81,22 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<MoveOnly>>(is, js);
+ testN<std::deque<MoveOnly, min_allocator<MoveOnly>>>(is, js);
+ testN<std::deque<MoveOnly, safe_allocator<MoveOnly>>>(is, js);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 ecae3f30844f3..15b09b83a4006 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
@@ -8,9 +8,6 @@
//
// REQUIRES: long_tests
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// iterator insert (const_iterator p, size_type n, const value_type& v);
@@ -117,6 +114,29 @@ TEST_CONSTEXPR_CXX26 void self_reference_test() {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+ constexpr int ks[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ for (int k : ks) {
+ testN<std::deque<int>>(i, j, k);
+ testN<std::deque<int, min_allocator<int>>>(i, j, k);
+ testN<std::deque<int, safe_allocator<int>>>(i, j, k);
+ }
+ }
+ }
+
+ self_reference_test<std::deque<int>>();
+ self_reference_test<std::deque<int, min_allocator<int>>>();
+ self_reference_test<std::deque<int, safe_allocator<int>>>();
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 a4d485fb15baa..597403b5d67c1 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// iterator insert (const_iterator p, const value_type& v);
@@ -103,6 +100,25 @@ TEST_CONSTEXPR_CXX26 void self_reference_test() {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(is, js);
+ testN<std::deque<int, min_allocator<int>>>(is, js);
+ testN<std::deque<int, safe_allocator<int>>>(is, js);
+ }
+ }
+
+ self_reference_test<std::deque<int>>();
+ self_reference_test<std::deque<int, min_allocator<int>>>();
+ self_reference_test<std::deque<int, safe_allocator<int>>>();
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 8ab78ef836504..25f9195b2069a 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void pop_back()
@@ -46,7 +43,18 @@ TEST_CONSTEXPR_CXX26 bool tests() {
queue.push_back(i);
while (queue.size() > 1) {
- test(queue);
+#if TEST_STD_VER >= 26
+ if ([dq_size = queue.size()] {
+ if consteval {
+ return (dq_size & (dq_size - 1)) == 0;
+ } else {
+ return true;
+ }
+ }())
+#endif
+ {
+ test(queue);
+ }
queue.pop_back();
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(queue));
}
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 f68d7f803dfc4..ff2e30b746447 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void pop_back()
@@ -62,6 +59,24 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ testN<std::deque<int, safe_allocator<int>>>(i, j);
+ }
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 64c66c56bdc51..4b935b9e8ade3 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void pop_front()
@@ -45,7 +42,18 @@ TEST_CONSTEXPR_CXX26 bool tests() {
queue.push_back(i);
while (queue.size() > 1) {
- test(queue);
+#if TEST_STD_VER >= 26
+ if ([dq_size = queue.size()] {
+ if consteval {
+ return (dq_size & (dq_size - 1)) == 0;
+ } else {
+ return true;
+ }
+ }())
+#endif
+ {
+ test(queue);
+ }
queue.pop_back();
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(queue));
}
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 103b230819726..9de8e69791d20 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void pop_front()
@@ -62,6 +59,21 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 e01465e38bbb1..7ca2d14a16d37 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void push_back(const value_type& v);
@@ -55,6 +52,17 @@ TEST_CONSTEXPR_CXX26 void test(int size) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is{0, 1025, 2047, 4096};
+ for (int i : is) {
+ test<std::deque<int>>(i);
+ test<std::deque<int, min_allocator<int>>>(i);
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
const int N = sizeof(rng) / sizeof(rng[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 238c19e5c82c8..d2336df4da01b 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
@@ -8,9 +8,6 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void push_back(value_type&& v);
@@ -58,6 +55,18 @@ TEST_CONSTEXPR_CXX26 void test(int size) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if constexpr {
+ constexpr int is{0, 2047, 4096};
+ for (int i : is) {
+ test<std::deque<MoveOnly>>(i);
+ test<std::deque<MoveOnly, min_allocator<MoveOnly>>>(i);
+ test<std::deque<MoveOnly, safe_allocator<MoveOnly>>>(i);
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
const int N = sizeof(rng) / sizeof(rng[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 a38bb8d336ef8..2a6517ca8e9e6 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void push_front(const value_type& v);
@@ -62,6 +59,22 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ testN<std::deque<int, safe_allocator<int>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 c7f948c86043b..9ab1f2415d2de 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
@@ -8,9 +8,6 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// void push_front(value_type&& v);
@@ -65,6 +62,21 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<MoveOnly>>(i, j);
+ testN<std::deque<MoveOnly, safe_allocator<MoveOnly>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 50973f7ffcb4d..18f142d24a41b 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// Optimization for deque::iterators
@@ -80,6 +77,22 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
+
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 744e26de03346..4db458220d0c1 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// Optimization for deque::iterators
@@ -79,6 +76,21 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 546b695e3090f..7e5fe4c5da132 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// Optimization for deque::iterators
@@ -79,6 +76,21 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 b16d395a5cbe0..7369b4fe6fd0b 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// Optimization for deque::iterators
@@ -79,6 +76,21 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+
+ for (int i : is) {
+ for (int j : js) {
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ }
+ }
+
+ return true;
+ }
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[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 c8853eb58015b..baea240f3475c 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
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=4294967295
-// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=4294967295
-
// <deque>
// template <class T, class A>
@@ -56,6 +53,18 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
}
TEST_CONSTEXPR_CXX26 bool tests() {
+#if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is{0, 1025, 2049};
+ constexpr int js{0, 1025, 2049};
+ constexpr int ks{0, 1025, 2049};
+
+ for (int i : is)
+ for (int j : js)
+ for (int k : ks)
+ testN<std::deque<int>>(i, j, k);
+ } else
+#endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -93,6 +102,18 @@ TEST_CONSTEXPR_CXX26 bool tests() {
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2));
}
#if TEST_STD_VER >= 11
+# if TEST_STD_VER >= 26
+ if consteval {
+ constexpr int is{0, 1025, 2049};
+ constexpr int js{0, 1025, 2049};
+ constexpr int ks{0, 1025, 2049};
+
+ for (int i : is)
+ for (int j : js)
+ for (int k : ks)
+ testN<std::deque<int, min_allocator<int>>>(i, j, k);
+ } else
+# endif
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng) / sizeof(rng[0]);
>From 746aa88a660263de371c0dc9a438d67cb5783888 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 18 Mar 2026 15:59:53 +0800
Subject: [PATCH 39/41] Fix copy-pasta
---
.../sequences/deque/deque.modifiers/emplace_back.pass.cpp | 2 +-
.../sequences/deque/deque.modifiers/emplace_front.pass.cpp | 2 +-
.../sequences/deque/deque.modifiers/insert_rvalue.pass.cpp | 6 +++---
.../sequences/deque/deque.modifiers/insert_value.pass.cpp | 6 +++---
.../sequences/deque/deque.modifiers/push_back.pass.cpp | 2 +-
.../deque/deque.modifiers/push_back_rvalue.pass.cpp | 2 +-
.../containers/sequences/deque/deque.special/swap.pass.cpp | 6 +++---
7 files changed, 13 insertions(+), 13 deletions(-)
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 9a4e4b7940f43..72f612aad3bce 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
@@ -76,7 +76,7 @@ TEST_CONSTEXPR_CXX26 bool tests() {
for (int i : is) {
for (int j : js) {
- testN<std::deque<Emplaceable>>(is, js);
+ testN<std::deque<Emplaceable>>(i, j);
testN<std::deque<Emplaceable, min_allocator<Emplaceable>>>(i, j);
}
}
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 5e430c317fac2..75088ad5b89e5 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
@@ -76,7 +76,7 @@ TEST_CONSTEXPR_CXX26 bool tests() {
for (int i : is) {
for (int j : js) {
- testN<std::deque<Emplaceable>>(is, js);
+ testN<std::deque<Emplaceable>>(i, j);
testN<std::deque<Emplaceable, min_allocator<Emplaceable>>>(i, j);
}
}
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 cd3cded63cd48..9980c4dd95c96 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
@@ -88,9 +88,9 @@ TEST_CONSTEXPR_CXX26 bool tests() {
for (int i : is) {
for (int j : js) {
- testN<std::deque<MoveOnly>>(is, js);
- testN<std::deque<MoveOnly, min_allocator<MoveOnly>>>(is, js);
- testN<std::deque<MoveOnly, safe_allocator<MoveOnly>>>(is, js);
+ testN<std::deque<MoveOnly>>(i, j);
+ testN<std::deque<MoveOnly, min_allocator<MoveOnly>>>(i, j);
+ testN<std::deque<MoveOnly, safe_allocator<MoveOnly>>>(i, j);
}
}
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 597403b5d67c1..1be55d53026ff 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
@@ -106,9 +106,9 @@ TEST_CONSTEXPR_CXX26 bool tests() {
constexpr int js[]{0, 1025, 2049};
for (int i : is) {
for (int j : js) {
- testN<std::deque<int>>(is, js);
- testN<std::deque<int, min_allocator<int>>>(is, js);
- testN<std::deque<int, safe_allocator<int>>>(is, js);
+ testN<std::deque<int>>(i, j);
+ testN<std::deque<int, min_allocator<int>>>(i, j);
+ testN<std::deque<int, safe_allocator<int>>>(i, j);
}
}
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 7ca2d14a16d37..4b62f0ec7cc38 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
@@ -54,7 +54,7 @@ TEST_CONSTEXPR_CXX26 void test(int size) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is{0, 1025, 2047, 4096};
+ constexpr int is[]{0, 1025, 2047, 4096};
for (int i : is) {
test<std::deque<int>>(i);
test<std::deque<int, min_allocator<int>>>(i);
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 d2336df4da01b..726d2553dbc5c 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
@@ -56,7 +56,7 @@ TEST_CONSTEXPR_CXX26 void test(int size) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
- if constexpr {
+ if consteval {
constexpr int is{0, 2047, 4096};
for (int i : is) {
test<std::deque<MoveOnly>>(i);
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 baea240f3475c..eb703edf953a7 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
@@ -55,9 +55,9 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is{0, 1025, 2049};
- constexpr int js{0, 1025, 2049};
- constexpr int ks{0, 1025, 2049};
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+ constexpr int ks[]{0, 1025, 2049};
for (int i : is)
for (int j : js)
>From 675f1da3c063c21bbf3e08c5d2d68212eeb3e910 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 18 Mar 2026 16:22:53 +0800
Subject: [PATCH 40/41] Fix copy-pasta, again
---
.../deque/deque.modifiers/push_back_rvalue.pass.cpp | 2 +-
.../containers/sequences/deque/deque.special/swap.pass.cpp | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
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 726d2553dbc5c..cf2befdb4e6b7 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
@@ -57,7 +57,7 @@ TEST_CONSTEXPR_CXX26 void test(int size) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is{0, 2047, 4096};
+ constexpr int is[]{0, 2047, 4096};
for (int i : is) {
test<std::deque<MoveOnly>>(i);
test<std::deque<MoveOnly, min_allocator<MoveOnly>>>(i);
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 eb703edf953a7..817a553a99661 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
@@ -104,9 +104,9 @@ TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 11
# if TEST_STD_VER >= 26
if consteval {
- constexpr int is{0, 1025, 2049};
- constexpr int js{0, 1025, 2049};
- constexpr int ks{0, 1025, 2049};
+ constexpr int is[]{0, 1025, 2049};
+ constexpr int js[]{0, 1025, 2049};
+ constexpr int ks[]{0, 1025, 2049};
for (int i : is)
for (int j : js)
>From 09a061c76c6814e70c16efda37e1884584565616 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Wed, 18 Mar 2026 16:55:58 +0800
Subject: [PATCH 41/41] Test small inputs during constant evaluation
---
.../sequences/deque/deque.capacity/resize_size.pass.cpp | 6 +++---
.../deque/deque.capacity/resize_size_value.pass.cpp | 6 +++---
.../sequences/deque/deque.capacity/shrink_to_fit.pass.cpp | 4 ++--
.../sequences/deque/deque.cons/assign_iter_iter.pass.cpp | 8 +++++---
.../sequences/deque/deque.cons/assign_size_value.pass.cpp | 6 +++---
.../containers/sequences/deque/deque.cons/size.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/emplace.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/emplace_back.pass.cpp | 4 ++--
.../deque/deque.modifiers/emplace_front.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/erase_iter.pass.cpp | 4 ++--
.../deque/deque.modifiers/erase_iter_iter.pass.cpp | 4 ++--
.../deque/deque.modifiers/insert_iter_iter.pass.cpp | 6 +++---
.../deque/deque.modifiers/insert_rvalue.pass.cpp | 4 ++--
.../deque/deque.modifiers/insert_size_value.pass.cpp | 6 +++---
.../sequences/deque/deque.modifiers/insert_value.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/pop_back.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/pop_front.pass.cpp | 4 ++--
.../sequences/deque/deque.modifiers/push_back.pass.cpp | 2 +-
.../deque/deque.modifiers/push_back_rvalue.pass.cpp | 2 +-
.../sequences/deque/deque.modifiers/push_front.pass.cpp | 4 ++--
.../deque/deque.modifiers/push_front_rvalue.pass.cpp | 4 ++--
.../sequences/deque/deque.special/copy.pass.cpp | 4 ++--
.../sequences/deque/deque.special/copy_backward.pass.cpp | 4 ++--
.../sequences/deque/deque.special/move.pass.cpp | 4 ++--
.../sequences/deque/deque.special/move_backward.pass.cpp | 4 ++--
.../sequences/deque/deque.special/swap.pass.cpp | 6 +++---
26 files changed, 59 insertions(+), 57 deletions(-)
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 e63e2101c9694..896d65699f07e 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
@@ -66,9 +66,9 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
TEST_CONSTEXPR_CXX26 bool test() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
- constexpr int ks[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
+ constexpr int ks[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 25c4118ee0781..dc99384b4f35f 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
@@ -66,9 +66,9 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
TEST_CONSTEXPR_CXX26 bool test() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
- constexpr int ks[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
+ constexpr int ks[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 5ad8bb5189690..885e623b04593 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
@@ -53,8 +53,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool test() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 62137146bd911..d86c235826c64 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
@@ -79,9 +79,9 @@ TEST_CONSTEXPR_CXX26 void testNI(int start, int N, int M) {
TEST_CONSTEXPR_CXX26 void basic_test() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
- constexpr int ks[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
+ constexpr int ks[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
@@ -96,6 +96,8 @@ TEST_CONSTEXPR_CXX26 void basic_test() {
testNI<std::deque<int>>(1500, 2000, 1000);
testNI<std::deque<int, min_allocator<int>>>(1500, 2000, 1000);
testNI<std::deque<int, safe_allocator<int>>>(1500, 2000, 1000);
+
+ return true;
}
#endif
{
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 793203343157e..3d8e9b3241f8a 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
@@ -58,9 +58,9 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
TEST_CONSTEXPR_CXX26 bool test() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
- constexpr int ks[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
+ constexpr int ks[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 e9a2d55c22d61..9015275a3e933 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
@@ -92,8 +92,8 @@ TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
test<DefaultOnly, std::allocator<DefaultOnly>>(0);
- test<DefaultOnly, std::allocator<DefaultOnly>>(2049);
- test<DefaultOnly, std::allocator<DefaultOnly>>(4097);
+ test<DefaultOnly, std::allocator<DefaultOnly>>(129);
+ test<DefaultOnly, std::allocator<DefaultOnly>>(513);
} else
#endif
{
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 f30132f890d4f..765113a7f36b1 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
@@ -77,8 +77,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 72f612aad3bce..ad518bb7e4f68 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
@@ -71,8 +71,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 75088ad5b89e5..7eadf309da984 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
@@ -71,8 +71,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 3b6b17419f3f0..6d995129aa9a3 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
@@ -96,8 +96,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 7174daf98117c..b7dff90596739 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
@@ -102,8 +102,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 b827603a73911..4617e1a360e48 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
@@ -238,9 +238,9 @@ TEST_CONSTEXPR_CXX26 void test_move() {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
- constexpr int ks[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
+ constexpr int ks[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 9980c4dd95c96..83b9e0bb4d00d 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
@@ -83,8 +83,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 15b09b83a4006..1c3259e1264ff 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
@@ -116,9 +116,9 @@ TEST_CONSTEXPR_CXX26 void self_reference_test() {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
- constexpr int ks[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
+ constexpr int ks[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 1be55d53026ff..5e5e228726af3 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
@@ -102,8 +102,8 @@ TEST_CONSTEXPR_CXX26 void self_reference_test() {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
testN<std::deque<int>>(i, j);
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 ff2e30b746447..2f6d0c39d2bec 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
@@ -61,8 +61,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 9de8e69791d20..8b318d22773ff 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
@@ -61,8 +61,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 4b62f0ec7cc38..03dadca0b1a61 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
@@ -54,7 +54,7 @@ TEST_CONSTEXPR_CXX26 void test(int size) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2047, 4096};
+ constexpr int is[]{0, 129, 257, 513};
for (int i : is) {
test<std::deque<int>>(i);
test<std::deque<int, min_allocator<int>>>(i);
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 cf2befdb4e6b7..eabb8201f2200 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
@@ -57,7 +57,7 @@ TEST_CONSTEXPR_CXX26 void test(int size) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 2047, 4096};
+ constexpr int is[]{0, 129, 257, 513};
for (int i : is) {
test<std::deque<MoveOnly>>(i);
test<std::deque<MoveOnly, min_allocator<MoveOnly>>>(i);
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 2a6517ca8e9e6..f03774888dddb 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
@@ -61,8 +61,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 9ab1f2415d2de..0ca457e3c8860 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
@@ -64,8 +64,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 18f142d24a41b..d4e8d706f4335 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
@@ -79,8 +79,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 4db458220d0c1..e033439986bf7 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
@@ -78,8 +78,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 7e5fe4c5da132..657ff066bac62 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
@@ -78,8 +78,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 7369b4fe6fd0b..764e85d110a57 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
@@ -78,8 +78,8 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
for (int i : is) {
for (int j : js) {
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 817a553a99661..46f900c6c93c9 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
@@ -55,9 +55,9 @@ TEST_CONSTEXPR_CXX26 void testN(int start, int N, int M) {
TEST_CONSTEXPR_CXX26 bool tests() {
#if TEST_STD_VER >= 26
if consteval {
- constexpr int is[]{0, 1025, 2049};
- constexpr int js[]{0, 1025, 2049};
- constexpr int ks[]{0, 1025, 2049};
+ constexpr int is[]{0, 129, 257};
+ constexpr int js[]{0, 129, 257};
+ constexpr int ks[]{0, 129, 257};
for (int i : is)
for (int j : js)
More information about the libcxx-commits
mailing list