[libcxx-commits] [libcxx] [libc++] constexpr `flat_set` (PR #140360)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jul 5 01:41:47 PDT 2025


https://github.com/huixie90 updated https://github.com/llvm/llvm-project/pull/140360

>From 42aa499acf7794d1d516c0f55f928988bff2c394 Mon Sep 17 00:00:00 2001
From: Hui Xie <hui.xie1990 at gmail.com>
Date: Sun, 4 May 2025 13:33:59 +0100
Subject: [PATCH 1/4] constexpr flat_set

---
 libcxx/include/__flat_set/flat_set.h          | 278 +++++++++++-------
 libcxx/include/__flat_set/utils.h             |   8 +-
 libcxx/include/module.modulemap.in            |   3 +
 libcxx/test/std/containers/Emplaceable.h      |   8 -
 .../flat.set/flat.set.capacity/empty.pass.cpp |  14 +-
 .../flat.set.capacity/max_size.pass.cpp       |   7 +-
 .../flat.set/flat.set.capacity/size.pass.cpp  |  17 +-
 .../flat.set/flat.set.cons/alloc.pass.cpp     |  26 +-
 .../assign_initializer_list.pass.cpp          |  14 +-
 .../flat.set/flat.set.cons/compare.pass.cpp   |  80 +++--
 .../flat.set.cons/containers.pass.cpp         | 106 ++++---
 .../flat.set/flat.set.cons/copy.pass.cpp      |  21 +-
 .../flat.set.cons/copy_alloc.pass.cpp         |  47 +--
 .../flat.set.cons/copy_assign.pass.cpp        |  27 +-
 .../flat.set/flat.set.cons/default.pass.cpp   |  42 ++-
 .../flat.set.cons/dtor_noexcept.pass.cpp      |  28 +-
 .../flat.set.cons/initializer_list.pass.cpp   | 121 ++++----
 .../flat.set/flat.set.cons/iter_iter.pass.cpp |  98 +++---
 .../flat.set/flat.set.cons/move.pass.cpp      |  64 ++--
 .../flat.set.cons/move_alloc.pass.cpp         |  51 ++--
 .../flat.set.cons/move_assign.pass.cpp        |  51 +++-
 .../flat.set/flat.set.cons/range.pass.cpp     |  93 ++++--
 .../flat.set.cons/sorted_container.pass.cpp   |  91 +++---
 .../sorted_initializer_list.pass.cpp          | 122 ++++----
 .../flat.set.cons/sorted_iter_iter.pass.cpp   |  93 +++---
 .../flat.set.erasure/erase_if.pass.cpp        |  26 +-
 .../flat.set.iterators/iterator.pass.cpp      |  14 +-
 .../iterator_comparison.pass.cpp              |  14 +-
 .../reverse_iterator.pass.cpp                 |  52 ++--
 .../flat.set.modifiers/clear.pass.cpp         |  15 +-
 .../flat.set.modifiers/emplace.pass.cpp       |  21 +-
 .../flat.set.modifiers/emplace_hint.pass.cpp  |  21 +-
 .../flat.set.modifiers/erase_iter.pass.cpp    |  14 +-
 .../erase_iter_iter.pass.cpp                  |  14 +-
 .../flat.set.modifiers/erase_key.pass.cpp     |  14 +-
 .../erase_key_transparent.pass.cpp            |  29 +-
 .../flat.set.modifiers/extract.pass.cpp       |  14 +-
 .../flat.set.modifiers/insert_cv.pass.cpp     |  14 +-
 .../insert_initializer_list.pass.cpp          |  14 +-
 .../insert_iter_cv.pass.cpp                   |  14 +-
 .../insert_iter_iter.pass.cpp                 |  14 +-
 .../insert_iter_rv.pass.cpp                   |  18 +-
 .../flat.set.modifiers/insert_range.pass.cpp  |  16 +-
 .../flat.set.modifiers/insert_rv.pass.cpp     |  18 +-
 .../insert_sorted_initializer_list.pass.cpp   |  14 +-
 .../insert_sorted_iter_iter.pass.cpp          |  14 +-
 .../insert_transparent.pass.cpp               |  14 +-
 .../flat.set.modifiers/replace.pass.cpp       |  14 +-
 .../flat.set.modifiers/swap_free.pass.cpp     |  15 +-
 .../flat.set.modifiers/swap_member.pass.cpp   |  14 +-
 .../flat.set/flat.set.observers/comp.pass.cpp |   9 +-
 .../flat.set.operations/contains.pass.cpp     |  14 +-
 .../contains_transparent.pass.cpp             |  14 +-
 .../flat.set.operations/count.pass.cpp        |  14 +-
 .../count_transparent.pass.cpp                |  14 +-
 .../flat.set.operations/equal_range.pass.cpp  |  14 +-
 .../equal_range_transparent.pass.cpp          |  14 +-
 .../flat.set.operations/find.pass.cpp         |  14 +-
 .../find_transparent.pass.cpp                 |  12 +-
 .../flat.set.operations/lower_bound.pass.cpp  |  14 +-
 .../lower_bound_transparent.pass.cpp          |  14 +-
 .../flat.set.operations/upper_bound.pass.cpp  |  14 +-
 .../upper_bound_transparent.pass.cpp          |  14 +-
 .../container.adaptors/flat.set/helpers.h     |   2 +-
 .../flat.set/incomplete_type.pass.cpp         |  11 +-
 .../flat.set/op_compare.pass.cpp              |  16 +-
 .../container.adaptors/flat_helpers.h         |  20 +-
 67 files changed, 1443 insertions(+), 732 deletions(-)

diff --git a/libcxx/include/__flat_set/flat_set.h b/libcxx/include/__flat_set/flat_set.h
index b8edd8eee0cfa..e677f67655842 100644
--- a/libcxx/include/__flat_set/flat_set.h
+++ b/libcxx/include/__flat_set/flat_set.h
@@ -107,13 +107,13 @@ class flat_set {
 
 public:
   // [flat.set.cons], construct/copy/destroy
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
   flat_set() noexcept(is_nothrow_default_constructible_v<_KeyContainer> && is_nothrow_default_constructible_v<_Compare>)
       : __keys_(), __compare_() {}
 
-  _LIBCPP_HIDE_FROM_ABI flat_set(const flat_set&) = default;
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(const flat_set&) = default;
 
-  _LIBCPP_HIDE_FROM_ABI flat_set(flat_set&& __other) noexcept(
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(flat_set&& __other) noexcept(
       is_nothrow_move_constructible_v<_KeyContainer> && is_nothrow_move_constructible_v<_Compare>)
 #  if _LIBCPP_HAS_EXCEPTIONS
       try
@@ -130,14 +130,17 @@ class flat_set {
 #  endif // _LIBCPP_HAS_EXCEPTIONS
   }
 
-  _LIBCPP_HIDE_FROM_ABI explicit flat_set(const key_compare& __comp) : __keys_(), __compare_(__comp) {}
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_set(const key_compare& __comp)
+      : __keys_(), __compare_(__comp) {}
 
-  _LIBCPP_HIDE_FROM_ABI explicit flat_set(container_type __keys, const key_compare& __comp = key_compare())
+  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_set(container_type __keys, const key_compare& __comp = key_compare())
       : __keys_(std::move(__keys)), __compare_(__comp) {
     __sort_and_unique();
   }
 
-  _LIBCPP_HIDE_FROM_ABI flat_set(sorted_unique_t, container_type __keys, const key_compare& __comp = key_compare())
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+  flat_set(sorted_unique_t, container_type __keys, const key_compare& __comp = key_compare())
       : __keys_(std::move(__keys)), __compare_(__comp) {
     _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
         __is_sorted_and_unique(__keys_), "Either the key container is not sorted or it contains duplicates");
@@ -145,7 +148,7 @@ class flat_set {
 
   template <class _InputIterator>
     requires __has_input_iterator_category<_InputIterator>::value
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
   flat_set(_InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())
       : __keys_(), __compare_(__comp) {
     insert(__first, __last);
@@ -153,7 +156,7 @@ class flat_set {
 
   template <class _InputIterator>
     requires __has_input_iterator_category<_InputIterator>::value
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
   flat_set(sorted_unique_t, _InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())
       : __keys_(__first, __last), __compare_(__comp) {
     _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
@@ -161,48 +164,52 @@ class flat_set {
   }
 
   template <_ContainerCompatibleRange<value_type> _Range>
-  _LIBCPP_HIDE_FROM_ABI flat_set(from_range_t, _Range&& __rg)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(from_range_t, _Range&& __rg)
       : flat_set(from_range, std::forward<_Range>(__rg), key_compare()) {}
 
   template <_ContainerCompatibleRange<value_type> _Range>
-  _LIBCPP_HIDE_FROM_ABI flat_set(from_range_t, _Range&& __rg, const key_compare& __comp) : flat_set(__comp) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(from_range_t, _Range&& __rg, const key_compare& __comp)
+      : flat_set(__comp) {
     insert_range(std::forward<_Range>(__rg));
   }
 
-  _LIBCPP_HIDE_FROM_ABI flat_set(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+  flat_set(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
       : flat_set(__il.begin(), __il.end(), __comp) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
   flat_set(sorted_unique_t, initializer_list<value_type> __il, const key_compare& __comp = key_compare())
       : flat_set(sorted_unique, __il.begin(), __il.end(), __comp) {}
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI explicit flat_set(const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_set(const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_() {}
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(const key_compare& __comp, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(const key_compare& __comp, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_(__comp) {}
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(const container_type& __keys, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(const container_type& __keys, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_() {
     __sort_and_unique();
   }
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(const container_type& __keys, const key_compare& __comp, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+  flat_set(const container_type& __keys, const key_compare& __comp, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_(__comp) {
     __sort_and_unique();
   }
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(sorted_unique_t, const container_type& __keys, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+  flat_set(sorted_unique_t, const container_type& __keys, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_() {
     _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
         __is_sorted_and_unique(__keys_), "Either the key container is not sorted or it contains duplicates");
@@ -210,7 +217,7 @@ class flat_set {
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
   flat_set(sorted_unique_t, const container_type& __keys, const key_compare& __comp, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __keys)), __compare_(__comp) {
     _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
@@ -219,13 +226,13 @@ class flat_set {
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(const flat_set& __other, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(const flat_set& __other, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __other.__keys_)),
         __compare_(__other.__compare_) {}
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(flat_set&& __other, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(flat_set&& __other, const _Allocator& __alloc)
 #  if _LIBCPP_HAS_EXCEPTIONS
       try
 #  endif // _LIBCPP_HAS_EXCEPTIONS
@@ -241,14 +248,15 @@ class flat_set {
 
   template <class _InputIterator, class _Allocator>
     requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)
-  _LIBCPP_HIDE_FROM_ABI flat_set(_InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+  flat_set(_InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_() {
     insert(__first, __last);
   }
 
   template <class _InputIterator, class _Allocator>
     requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
   flat_set(_InputIterator __first, _InputIterator __last, const key_compare& __comp, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_(__comp) {
     insert(__first, __last);
@@ -256,7 +264,7 @@ class flat_set {
 
   template <class _InputIterator, class _Allocator>
     requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
   flat_set(sorted_unique_t, _InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __first, __last)), __compare_() {
     _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
@@ -265,12 +273,12 @@ class flat_set {
 
   template <class _InputIterator, class _Allocator>
     requires(__has_input_iterator_category<_InputIterator>::value && uses_allocator<container_type, _Allocator>::value)
-  _LIBCPP_HIDE_FROM_ABI
-  flat_set(sorted_unique_t,
-           _InputIterator __first,
-           _InputIterator __last,
-           const key_compare& __comp,
-           const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(
+      sorted_unique_t,
+      _InputIterator __first,
+      _InputIterator __last,
+      const key_compare& __comp,
+      const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc, __first, __last)), __compare_(__comp) {
     _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
         __is_sorted_and_unique(__keys_), "Either the key container is not sorted or it contains duplicates");
@@ -278,49 +286,52 @@ class flat_set {
 
   template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(from_range_t, _Range&& __rg, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set(from_range_t, _Range&& __rg, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_() {
     insert_range(std::forward<_Range>(__rg));
   }
 
   template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(from_range_t, _Range&& __rg, const key_compare& __comp, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+  flat_set(from_range_t, _Range&& __rg, const key_compare& __comp, const _Allocator& __alloc)
       : __keys_(std::make_obj_using_allocator<container_type>(__alloc)), __compare_(__comp) {
     insert_range(std::forward<_Range>(__rg));
   }
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(initializer_list<value_type> __il, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+  flat_set(initializer_list<value_type> __il, const _Allocator& __alloc)
       : flat_set(__il.begin(), __il.end(), __alloc) {}
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
   flat_set(initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)
       : flat_set(__il.begin(), __il.end(), __comp, __alloc) {}
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI flat_set(sorted_unique_t, initializer_list<value_type> __il, const _Allocator& __alloc)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+  flat_set(sorted_unique_t, initializer_list<value_type> __il, const _Allocator& __alloc)
       : flat_set(sorted_unique, __il.begin(), __il.end(), __alloc) {}
 
   template <class _Allocator>
     requires uses_allocator<container_type, _Allocator>::value
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
   flat_set(sorted_unique_t, initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)
       : flat_set(sorted_unique, __il.begin(), __il.end(), __comp, __alloc) {}
 
-  _LIBCPP_HIDE_FROM_ABI flat_set& operator=(initializer_list<value_type> __il) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set& operator=(initializer_list<value_type> __il) {
     clear();
     insert(__il);
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI flat_set& operator=(const flat_set&) = default;
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set& operator=(const flat_set&) = default;
 
-  _LIBCPP_HIDE_FROM_ABI flat_set& operator=(flat_set&& __other) noexcept(
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_set& operator=(flat_set&& __other) noexcept(
       is_nothrow_move_assignable_v<_KeyContainer> && is_nothrow_move_assignable_v<_Compare>) {
     // No matter what happens, we always want to clear the other container before returning
     // since we moved from it
@@ -336,31 +347,53 @@ class flat_set {
   }
 
   // iterators
-  _LIBCPP_HIDE_FROM_ABI iterator begin() noexcept { return iterator(std::as_const(__keys_).begin()); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept { return const_iterator(__keys_.begin()); }
-  _LIBCPP_HIDE_FROM_ABI iterator end() noexcept { return iterator(std::as_const(__keys_).end()); }
-  _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept { return const_iterator(__keys_.end()); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() noexcept {
+    return iterator(std::as_const(__keys_).begin());
+  }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const noexcept {
+    return const_iterator(__keys_.begin());
+  }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() noexcept {
+    return iterator(std::as_const(__keys_).end());
+  }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const noexcept {
+    return const_iterator(__keys_.end());
+  }
 
-  _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() noexcept { return reverse_iterator(end()); }
-  _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
-  _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() noexcept { return reverse_iterator(begin()); }
-  _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+  _LIBCPP_HIDE_FROM_ABI _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());
+  }
 
   // [flat.set.capacity], capacity
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool empty() const noexcept { return __keys_.empty(); }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const noexcept {
+    return __keys_.empty();
+  }
 
-  _LIBCPP_HIDE_FROM_ABI size_type size() const noexcept { return __keys_.size(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const noexcept { return __keys_.size(); }
 
-  _LIBCPP_HIDE_FROM_ABI size_type max_size() const noexcept { return __keys_.max_size(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const noexcept { return __keys_.max_size(); }
 
   // [flat.set.modifiers], modifiers
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> emplace(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> emplace(_Args&&... __args) {
     if constexpr (sizeof...(__args) == 1 && (is_same_v<remove_cvref_t<_Args>, _Key> && ...)) {
       return __emplace(std::forward<_Args>(__args)...);
     } else {
@@ -369,7 +402,7 @@ class flat_set {
   }
 
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __hint, _Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator emplace_hint(const_iterator __hint, _Args&&... __args) {
     if constexpr (sizeof...(__args) == 1 && (is_same_v<remove_cvref_t<_Args>, _Key> && ...)) {
       return __emplace_hint(std::move(__hint), std::forward<_Args>(__args)...);
     } else {
@@ -377,32 +410,36 @@ class flat_set {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(const value_type& __x) { return emplace(__x); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> insert(const value_type& __x) {
+    return emplace(__x);
+  }
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(value_type&& __x) { return emplace(std::move(__x)); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> insert(value_type&& __x) {
+    return emplace(std::move(__x));
+  }
 
   template <class _Kp>
     requires(__is_transparent_v<_Compare> && is_constructible_v<value_type, _Kp>)
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> insert(_Kp&& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> insert(_Kp&& __x) {
     return __emplace(std::forward<_Kp>(__x));
   }
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, const value_type& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, const value_type& __x) {
     return emplace_hint(__hint, __x);
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, value_type&& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, value_type&& __x) {
     return emplace_hint(__hint, std::move(__x));
   }
 
   template <class _Kp>
     requires(__is_transparent_v<_Compare> && is_constructible_v<value_type, _Kp>)
-  _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __hint, _Kp&& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator insert(const_iterator __hint, _Kp&& __x) {
     return __emplace_hint(__hint, std::forward<_Kp>(__x));
   }
 
   template <class _InputIterator>
     requires __has_input_iterator_category<_InputIterator>::value
-  _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(_InputIterator __first, _InputIterator __last) {
     if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {
       __reserve(__last - __first);
     }
@@ -411,7 +448,8 @@ class flat_set {
 
   template <class _InputIterator>
     requires __has_input_iterator_category<_InputIterator>::value
-  _LIBCPP_HIDE_FROM_ABI void insert(sorted_unique_t, _InputIterator __first, _InputIterator __last) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+  insert(sorted_unique_t, _InputIterator __first, _InputIterator __last) {
     if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>) {
       __reserve(__last - __first);
     }
@@ -420,7 +458,7 @@ class flat_set {
   }
 
   template <_ContainerCompatibleRange<value_type> _Range>
-  _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert_range(_Range&& __range) {
     if constexpr (ranges::sized_range<_Range>) {
       __reserve(ranges::size(__range));
     }
@@ -428,19 +466,21 @@ class flat_set {
     __append_sort_merge_unique</*WasSorted = */ false>(std::forward<_Range>(__range));
   }
 
-  _LIBCPP_HIDE_FROM_ABI void insert(initializer_list<value_type> __il) { insert(__il.begin(), __il.end()); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(initializer_list<value_type> __il) {
+    insert(__il.begin(), __il.end());
+  }
 
-  _LIBCPP_HIDE_FROM_ABI void insert(sorted_unique_t, initializer_list<value_type> __il) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void insert(sorted_unique_t, initializer_list<value_type> __il) {
     insert(sorted_unique, __il.begin(), __il.end());
   }
 
-  _LIBCPP_HIDE_FROM_ABI container_type extract() && {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 container_type extract() && {
     auto __guard = std::__make_scope_guard([&]() noexcept { clear() /* noexcept */; });
     auto __ret   = std::move(__keys_);
     return __ret;
   }
 
-  _LIBCPP_HIDE_FROM_ABI void replace(container_type&& __keys) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void replace(container_type&& __keys) {
     _LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
         __is_sorted_and_unique(__keys), "Either the key container is not sorted or it contains duplicates");
     auto __guard = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
@@ -448,7 +488,7 @@ class flat_set {
     __guard.__complete();
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(iterator __position) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(iterator __position) {
     auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
     auto __key_iter   = __keys_.erase(__position.__base());
     __on_failure.__complete();
@@ -458,7 +498,7 @@ class flat_set {
   // The following overload is the same as the iterator overload
   // iterator erase(const_iterator __position);
 
-  _LIBCPP_HIDE_FROM_ABI size_type erase(const key_type& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(const key_type& __x) {
     auto __iter = find(__x);
     if (__iter != end()) {
       erase(__iter);
@@ -470,21 +510,21 @@ class flat_set {
   template <class _Kp>
     requires(__is_transparent_v<_Compare> && !is_convertible_v<_Kp &&, iterator> &&
              !is_convertible_v<_Kp &&, const_iterator>)
-  _LIBCPP_HIDE_FROM_ABI size_type erase(_Kp&& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type erase(_Kp&& __x) {
     auto [__first, __last] = equal_range(__x);
     auto __res             = __last - __first;
     erase(__first, __last);
     return __res;
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator erase(const_iterator __first, const_iterator __last) {
     auto __on_failure = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
     auto __key_it     = __keys_.erase(__first.__base(), __last.__base());
     __on_failure.__complete();
     return iterator(std::move(__key_it));
   }
 
-  _LIBCPP_HIDE_FROM_ABI void swap(flat_set& __y) noexcept {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(flat_set& __y) noexcept {
     // warning: The spec has unconditional noexcept, which means that
     // if any of the following functions throw an exception,
     // std::terminate will be called.
@@ -493,121 +533,134 @@ class flat_set {
     ranges::swap(__keys_, __y.__keys_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI void clear() noexcept { __keys_.clear(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void clear() noexcept { __keys_.clear(); }
 
   // observers
-  _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __compare_; }
-  _LIBCPP_HIDE_FROM_ABI value_compare value_comp() const { return __compare_; }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 key_compare key_comp() const { return __compare_; }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare value_comp() const { return __compare_; }
 
   // set operations
-  _LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __x) { return __find_impl(*this, __x); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const key_type& __x) {
+    return __find_impl(*this, __x);
+  }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __x) const { return __find_impl(*this, __x); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const key_type& __x) const {
+    return __find_impl(*this, __x);
+  }
 
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI iterator find(const _Kp& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator find(const _Kp& __x) {
     return __find_impl(*this, __x);
   }
 
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Kp& __x) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator find(const _Kp& __x) const {
     return __find_impl(*this, __x);
   }
 
-  _LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __x) const { return contains(__x) ? 1 : 0; }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const key_type& __x) const {
+    return contains(__x) ? 1 : 0;
+  }
 
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI size_type count(const _Kp& __x) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type count(const _Kp& __x) const {
     return contains(__x) ? 1 : 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __x) const { return find(__x) != end(); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const key_type& __x) const {
+    return find(__x) != end();
+  }
 
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI bool contains(const _Kp& __x) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool contains(const _Kp& __x) const {
     return find(__x) != end();
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __x) {
     const auto& __keys = __keys_;
     return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __x) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const key_type& __x) const {
     return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
   }
 
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _Kp& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _Kp& __x) {
     const auto& __keys = __keys_;
     return iterator(std::lower_bound(__keys.begin(), __keys.end(), __x, __compare_));
   }
 
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _Kp& __x) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const _Kp& __x) const {
     return const_iterator(std::lower_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __x) {
     const auto& __keys = __keys_;
     return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __x) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const key_type& __x) const {
     return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
   }
 
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _Kp& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _Kp& __x) {
     const auto& __keys = __keys_;
     return iterator(std::upper_bound(__keys.begin(), __keys.end(), __x, __compare_));
   }
 
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _Kp& __x) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const _Kp& __x) const {
     return const_iterator(std::upper_bound(__keys_.begin(), __keys_.end(), __x, __compare_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const key_type& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const key_type& __x) {
     return __equal_range_impl(*this, __x);
   }
 
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const key_type& __x) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
+  equal_range(const key_type& __x) const {
     return __equal_range_impl(*this, __x);
   }
 
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _Kp& __x) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, iterator> equal_range(const _Kp& __x) {
     return __equal_range_impl(*this, __x);
   }
   template <class _Kp>
     requires __is_transparent_v<_Compare>
-  _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _Kp& __x) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<const_iterator, const_iterator>
+  equal_range(const _Kp& __x) const {
     return __equal_range_impl(*this, __x);
   }
 
-  friend _LIBCPP_HIDE_FROM_ABI bool operator==(const flat_set& __x, const flat_set& __y) {
+  friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool operator==(const flat_set& __x, const flat_set& __y) {
     return ranges::equal(__x, __y);
   }
 
-  friend _LIBCPP_HIDE_FROM_ABI auto operator<=>(const flat_set& __x, const flat_set& __y) {
+  friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 auto
+  operator<=>(const flat_set& __x, const flat_set& __y) {
     return std::lexicographical_compare_three_way(
         __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
   }
 
-  friend _LIBCPP_HIDE_FROM_ABI void swap(flat_set& __x, flat_set& __y) noexcept { __x.swap(__y); }
+  friend _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void swap(flat_set& __x, flat_set& __y) noexcept {
+    __x.swap(__y);
+  }
 
 private:
-  _LIBCPP_HIDE_FROM_ABI bool __is_sorted_and_unique(auto&& __key_container) const {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __is_sorted_and_unique(auto&& __key_container) const {
     auto __greater_or_equal_to = [this](const auto& __x, const auto& __y) { return !__compare_(__x, __y); };
     return ranges::adjacent_find(__key_container, __greater_or_equal_to) == ranges::end(__key_container);
   }
@@ -615,14 +668,14 @@ class flat_set {
   // This function is only used in constructors. So there is not exception handling in this function.
   // If the function exits via an exception, there will be no flat_set object constructed, thus, there
   // is no invariant state to preserve
-  _LIBCPP_HIDE_FROM_ABI void __sort_and_unique() {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __sort_and_unique() {
     ranges::sort(__keys_, __compare_);
     auto __dup_start = ranges::unique(__keys_, __key_equiv(__compare_)).begin();
     __keys_.erase(__dup_start, __keys_.end());
   }
 
   template <bool _WasSorted, class... _Args>
-  _LIBCPP_HIDE_FROM_ABI void __append_sort_merge_unique(_Args&&... __args) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __append_sort_merge_unique(_Args&&... __args) {
     auto __on_failure    = std::__make_exception_guard([&]() noexcept { clear() /* noexcept */; });
     size_type __old_size = size();
     __flat_set_utils::__append(*this, std::forward<_Args>(__args)...);
@@ -642,7 +695,7 @@ class flat_set {
   }
 
   template <class _Self, class _Kp>
-  _LIBCPP_HIDE_FROM_ABI static auto __find_impl(_Self&& __self, const _Kp& __key) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto __find_impl(_Self&& __self, const _Kp& __key) {
     auto __it   = __self.lower_bound(__key);
     auto __last = __self.end();
     if (__it == __last || __self.__compare_(__key, *__it)) {
@@ -652,7 +705,7 @@ class flat_set {
   }
 
   template <class _Self, class _Kp>
-  _LIBCPP_HIDE_FROM_ABI static auto __equal_range_impl(_Self&& __self, const _Kp& __key) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto __equal_range_impl(_Self&& __self, const _Kp& __key) {
     using __iter = _If<is_const_v<__libcpp_remove_reference_t<_Self>>, const_iterator, iterator>;
     auto __it    = std::lower_bound(__self.__keys_.begin(), __self.__keys_.end(), __key, __self.__compare_);
     auto __last  = __self.__keys_.end();
@@ -663,7 +716,7 @@ class flat_set {
   }
 
   template <class _Kp>
-  _LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __emplace(_Kp&& __key) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> __emplace(_Kp&& __key) {
     auto __it = lower_bound(__key);
     if (__it == end() || __compare_(__key, *__it)) {
       return pair<iterator, bool>(__flat_set_utils::__emplace_exact_pos(*this, __it, std::forward<_Kp>(__key)), true);
@@ -673,7 +726,7 @@ class flat_set {
   }
 
   template <class _Kp>
-  _LIBCPP_HIDE_FROM_ABI bool __is_hint_correct(const_iterator __hint, _Kp&& __key) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool __is_hint_correct(const_iterator __hint, _Kp&& __key) {
     if (__hint != cbegin() && !__compare_(*std::prev(__hint), __key)) {
       return false;
     }
@@ -684,7 +737,7 @@ class flat_set {
   }
 
   template <class _Kp>
-  _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint(const_iterator __hint, _Kp&& __key) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __emplace_hint(const_iterator __hint, _Kp&& __key) {
     if (__is_hint_correct(__hint, __key)) {
       if (__hint == cend() || __compare_(__key, *__hint)) {
         return __flat_set_utils::__emplace_exact_pos(*this, __hint, std::forward<_Kp>(__key));
@@ -697,7 +750,7 @@ class flat_set {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI void __reserve(size_t __size) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __reserve(size_t __size) {
     if constexpr (__container_traits<_KeyContainer>::__reservable) {
       __keys_.reserve(__size);
     }
@@ -705,14 +758,15 @@ class flat_set {
 
   template <class _Key2, class _Compare2, class _KeyContainer2, class _Predicate>
   friend typename flat_set<_Key2, _Compare2, _KeyContainer2>::size_type
-  erase_if(flat_set<_Key2, _Compare2, _KeyContainer2>&, _Predicate);
+  _LIBCPP_CONSTEXPR_SINCE_CXX26 erase_if(flat_set<_Key2, _Compare2, _KeyContainer2>&, _Predicate);
 
   _KeyContainer __keys_;
   _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;
 
   struct __key_equiv {
-    _LIBCPP_HIDE_FROM_ABI __key_equiv(key_compare __c) : __comp_(__c) {}
-    _LIBCPP_HIDE_FROM_ABI bool operator()(const_reference __x, const_reference __y) const {
+    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __key_equiv(key_compare __c) : __comp_(__c) {}
+    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
+    operator()(const_reference __x, const_reference __y) const {
       return !__comp_(__x, __y) && !__comp_(__y, __x);
     }
     key_compare __comp_;
@@ -799,7 +853,7 @@ struct uses_allocator<flat_set<_Key, _Compare, _KeyContainer>, _Allocator>
     : bool_constant<uses_allocator_v<_KeyContainer, _Allocator>> {};
 
 template <class _Key, class _Compare, class _KeyContainer, class _Predicate>
-_LIBCPP_HIDE_FROM_ABI typename flat_set<_Key, _Compare, _KeyContainer>::size_type
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 typename flat_set<_Key, _Compare, _KeyContainer>::size_type
 erase_if(flat_set<_Key, _Compare, _KeyContainer>& __flat_set, _Predicate __pred) {
   auto __guard = std::__make_exception_guard([&] { __flat_set.clear(); });
   auto __it    = std::remove_if(__flat_set.__keys_.begin(), __flat_set.__keys_.end(), [&](const auto& __e) -> bool {
diff --git a/libcxx/include/__flat_set/utils.h b/libcxx/include/__flat_set/utils.h
index 542bfd886aef5..8a7f93a00465d 100644
--- a/libcxx/include/__flat_set/utils.h
+++ b/libcxx/include/__flat_set/utils.h
@@ -38,7 +38,8 @@ struct __flat_set_utils {
   // When an exception is thrown during the emplacement, the function will clear the set if the container does not
   // have strong exception safety guarantee on emplacement.
   template <class _Set, class _Iter, class _KeyArg>
-  _LIBCPP_HIDE_FROM_ABI static auto __emplace_exact_pos(_Set& __set, _Iter&& __iter, _KeyArg&& __key) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static auto
+  __emplace_exact_pos(_Set& __set, _Iter&& __iter, _KeyArg&& __key) {
     using _KeyContainer = typename decay_t<_Set>::container_type;
     auto __on_failure   = std::__make_exception_guard([&]() noexcept {
       if constexpr (!__container_traits<_KeyContainer>::__emplacement_has_strong_exception_safety_guarantee) {
@@ -51,12 +52,13 @@ struct __flat_set_utils {
   }
 
   template <class _Set, class _InputIterator>
-  _LIBCPP_HIDE_FROM_ABI static void __append(_Set& __set, _InputIterator __first, _InputIterator __last) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static void
+  __append(_Set& __set, _InputIterator __first, _InputIterator __last) {
     __set.__keys_.insert(__set.__keys_.end(), std::move(__first), std::move(__last));
   }
 
   template <class _Set, class _Range>
-  _LIBCPP_HIDE_FROM_ABI static void __append(_Set& __set, _Range&& __rng) {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static void __append(_Set& __set, _Range&& __rng) {
     if constexpr (requires { __set.__keys_.insert_range(__set.__keys_.end(), std::forward<_Range>(__rng)); }) {
       // C++23 Sequence Container should have insert_range member function
       // Note that not all Sequence Containers provide append_range.
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index b00a8ebd54623..da39ac6103897 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -1320,6 +1320,9 @@ module std [system] {
     export std.flat_map.sorted_unique
     export std.flat_map.sorted_equivalent
     export *
+    export std.algorithm.ranges_sort
+    export std.ranges.zip_view
+    export std.tuple
   }
 
   module format {
diff --git a/libcxx/test/std/containers/Emplaceable.h b/libcxx/test/std/containers/Emplaceable.h
index d8d3407791731..e84a6381ab0f3 100644
--- a/libcxx/test/std/containers/Emplaceable.h
+++ b/libcxx/test/std/containers/Emplaceable.h
@@ -44,13 +44,5 @@ class Emplaceable {
   TEST_CONSTEXPR_CXX20 int get() const { return int_; }
 };
 
-template <>
-struct std::hash<Emplaceable> {
-  typedef Emplaceable argument_type;
-  typedef std::size_t result_type;
-
-  TEST_CONSTEXPR_CXX20 std::size_t operator()(const Emplaceable& x) const { return static_cast<std::size_t>(x.get()); }
-};
-
 #endif // TEST_STD_VER >= 11
 #endif // EMPLACEABLE_H
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/empty.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/empty.pass.cpp
index 223b92fc3e8e8..076102c616d44 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/empty.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/empty.pass.cpp
@@ -24,7 +24,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<int>, KeyContainer>;
   M m;
@@ -38,15 +38,23 @@ void test_one() {
   assert(m.empty());
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.capacity/max_size.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/max_size.pass.cpp
index dde1f7092e5b1..e2f52ab458c4c 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/max_size.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/max_size.pass.cpp
@@ -24,7 +24,7 @@
 #include "test_allocator.h"
 #include "test_macros.h"
 
-void test() {
+constexpr bool test() {
   {
     using A1 = limited_allocator<int, 10>;
     using C  = std::flat_set<int, std::less<int>, std::vector<int, A1>>;
@@ -59,10 +59,15 @@ void test() {
     assert(c.max_size() <= max_dist);
     assert(c.max_size() <= alloc_max_size(std::allocator<char>()));
   }
+
+  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/container.adaptors/flat.set/flat.set.capacity/size.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/size.pass.cpp
index 9f5ffdd066351..278d5ea2cdefd 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/size.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/size.pass.cpp
@@ -16,6 +16,7 @@
 #include <deque>
 #include <flat_set>
 #include <functional>
+#include <type_traits>
 #include <vector>
 
 #include "MinSequenceContainer.h"
@@ -23,7 +24,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using M = std::flat_set<int, std::less<int>, KeyContainer>;
   using S = typename M::size_type;
   {
@@ -46,7 +47,7 @@ void test_one() {
   }
   {
     M m;
-    S s = 1000000;
+    S s = std::is_constant_evaluated() ? 100 : 1000000;
     for (auto i = 0u; i < s; ++i) {
       m.emplace(i);
     }
@@ -56,15 +57,23 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.cons/alloc.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/alloc.pass.cpp
index d14e883dd5e93..00a0d4849c2ed 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/alloc.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/alloc.pass.cpp
@@ -14,15 +14,18 @@
 //   explicit flat_set(const Allocator& a);
 
 #include <cassert>
+#include <deque>
 #include <flat_set>
 #include <functional>
 #include <vector>
 
+#include "MinSequenceContainer.h"
 #include "test_macros.h"
 #include "test_allocator.h"
 #include "../../../test_compare.h"
 
-void test() {
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
     // The constructors in this subclause shall not participate in overload
     // resolution unless uses_allocator_v<container_type, Alloc> is true.
@@ -30,8 +33,8 @@ void test() {
     using C  = test_less<int>;
     using A1 = test_allocator<int>;
     using A2 = other_allocator<int>;
-    using V1 = std::vector<int, A1>;
-    using V2 = std::vector<int, A2>;
+    using V1 = KeyContainer<int, A1>;
+    using V2 = KeyContainer<int, A2>;
     using M1 = std::flat_set<int, C, V1>;
     using M2 = std::flat_set<int, C, V2>;
     static_assert(std::is_constructible_v<M1, const A1&>);
@@ -41,14 +44,14 @@ void test() {
   }
   {
     // explicit
-    using M = std::flat_set<int, std::less<int>, std::vector<int, test_allocator<int>>>;
+    using M = std::flat_set<int, std::less<int>, KeyContainer<int, test_allocator<int>>>;
 
     static_assert(std::is_constructible_v<M, test_allocator<int>>);
     static_assert(!std::is_convertible_v<test_allocator<int>, M>);
   }
   {
     using A = test_allocator<short>;
-    using M = std::flat_set<int, std::less<int>, std::vector<int, test_allocator<int>>>;
+    using M = std::flat_set<int, std::less<int>, KeyContainer<int, test_allocator<int>>>;
     M m(A(0, 5));
     assert(m.empty());
     assert(m.begin() == m.end());
@@ -57,8 +60,21 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/assign_initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/assign_initializer_list.pass.cpp
index ad49b62149036..44ac9d1a9040d 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/assign_initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/assign_initializer_list.pass.cpp
@@ -24,7 +24,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   {
@@ -45,17 +45,25 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.cons/compare.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/compare.pass.cpp
index 110757a1bb9ab..814445f91c17f 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/compare.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/compare.pass.cpp
@@ -23,27 +23,14 @@
 #include "test_macros.h"
 #include "../../../test_compare.h"
 #include "test_allocator.h"
+#include "MinSequenceContainer.h"
+#include "min_allocator.h"
 
-void test() {
-  {
-    // The constructors in this subclause shall not participate in overload
-    // resolution unless uses_allocator_v<container_type, Alloc> is true.
-
-    using C  = test_less<int>;
-    using A1 = test_allocator<int>;
-    using A2 = other_allocator<int>;
-    using V1 = std::vector<int, A1>;
-    using V2 = std::vector<int, A2>;
-    using M1 = std::flat_set<int, C, V1>;
-    using M2 = std::flat_set<int, C, V2>;
-    static_assert(std::is_constructible_v<M1, const C&, const A1&>);
-    static_assert(std::is_constructible_v<M2, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, const C&, const A1&>);
-  }
+template <class KeyContainer>
+constexpr void test_compare() {
   {
     using C = test_less<int>;
-    auto m  = std::flat_set<int, C>(C(3));
+    auto m  = std::flat_set<int, C, KeyContainer>(C(3));
     assert(m.empty());
     assert(m.begin() == m.end());
     assert(m.key_comp() == C(3));
@@ -51,16 +38,20 @@ void test() {
   {
     // The one-argument ctor is explicit.
     using C = test_less<int>;
-    static_assert(std::is_constructible_v<std::flat_set<int, C>, C>);
-    static_assert(!std::is_convertible_v<C, std::flat_set<int, C>>);
+    static_assert(std::is_constructible_v<std::flat_set<int, C, KeyContainer>, C>);
+    static_assert(!std::is_convertible_v<C, std::flat_set<int, C, KeyContainer>>);
 
-    static_assert(std::is_constructible_v<std::flat_set<int>, std::less<int>>);
-    static_assert(!std::is_convertible_v<std::less<int>, std::flat_set<int>>);
+    static_assert(std::is_constructible_v<std::flat_set<int, std::less<int>, KeyContainer>, std::less<int>>);
+    static_assert(!std::is_convertible_v<std::less<int>, std::flat_set<int, std::less<int>, KeyContainer>>);
   }
+}
+
+template <template <class...> class KeyContainer>
+constexpr void test_compare_alloc() {
   {
     using C  = test_less<int>;
     using A1 = test_allocator<int>;
-    auto m   = std::flat_set<int, C, std::vector<int, A1>>(C(4), A1(5));
+    auto m   = std::flat_set<int, C, KeyContainer<int, A1>>(C(4), A1(5));
     assert(m.empty());
     assert(m.begin() == m.end());
     assert(m.key_comp() == C(4));
@@ -69,9 +60,9 @@ void test() {
   }
   {
     // explicit(false)
-    using C                                      = test_less<int>;
-    using A1                                     = test_allocator<int>;
-    std::flat_set<int, C, std::deque<int, A1>> m = {C(4), A1(5)};
+    using C                                        = test_less<int>;
+    using A1                                       = test_allocator<int>;
+    std::flat_set<int, C, KeyContainer<int, A1>> m = {C(4), A1(5)};
     assert(m.empty());
     assert(m.begin() == m.end());
     assert(m.key_comp() == C(4));
@@ -80,8 +71,45 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  {
+    // The constructors in this subclause shall not participate in overload
+    // resolution unless uses_allocator_v<container_type, Alloc> is true.
+
+    using C  = test_less<int>;
+    using A1 = test_allocator<int>;
+    using A2 = other_allocator<int>;
+    using V1 = std::vector<int, A1>;
+    using V2 = std::vector<int, A2>;
+    using M1 = std::flat_set<int, C, V1>;
+    using M2 = std::flat_set<int, C, V2>;
+    static_assert(std::is_constructible_v<M1, const C&, const A1&>);
+    static_assert(std::is_constructible_v<M2, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, const C&, const A1&>);
+  }
+  test_compare<std::vector<int>>();
+  test_compare<MinSequenceContainer<int>>();
+  test_compare<std::vector<int, min_allocator<int>>>();
+
+  test_compare_alloc<std::vector>();
+
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+  {
+    test_compare<std::deque<int>>();
+    test_compare_alloc<std::deque>();
+  }
+
+  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/container.adaptors/flat.set/flat.set.cons/containers.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/containers.pass.cpp
index 6b1246885bf52..aaaa19a8a6d33 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/containers.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/containers.pass.cpp
@@ -36,44 +36,24 @@ void conversion_test(T);
 template <class T, class... Args>
 concept ImplicitlyConstructible = requires(Args&&... args) { conversion_test<T>({std::forward<Args>(args)...}); };
 
-void test() {
-  {
-    // The constructors in this subclause shall not participate in overload
-    // resolution unless uses_allocator_v<container_type, Alloc> is true.
-
-    using C  = test_less<int>;
-    using A1 = test_allocator<int>;
-    using A2 = other_allocator<int>;
-    using V1 = std::vector<int, A1>;
-    using V2 = std::vector<int, A2>;
-    using M1 = std::flat_set<int, C, V1>;
-    using M2 = std::flat_set<int, C, V2>;
-    static_assert(std::is_constructible_v<M1, const V1&, const A1&>);
-    static_assert(std::is_constructible_v<M2, const V2&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, const V1&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, const V2&, const A1&>);
-
-    static_assert(std::is_constructible_v<M1, const V1&, const C&, const A1&>);
-    static_assert(std::is_constructible_v<M2, const V2&, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, const V1&, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, const V2&, const C&, const A1&>);
-  }
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
     // flat_set(container_type)
-    using M             = std::flat_set<int>;
-    std::vector<int> ks = {1, 1, 1, 2, 2, 3, 2, 3, 3};
-    auto m              = M(ks);
+    using M              = std::flat_set<int, std::less<int>, KeyContainer<int>>;
+    KeyContainer<int> ks = {1, 1, 1, 2, 2, 3, 2, 3, 3};
+    auto m               = M(ks);
     assert(std::ranges::equal(m, std::vector<int>{1, 2, 3}));
 
     // explicit
-    static_assert(std::is_constructible_v<M, const std::vector<int>&>);
-    static_assert(!ImplicitlyConstructible<M, const std::vector<int>&>);
+    static_assert(std::is_constructible_v<M, const KeyContainer<int>&>);
+    static_assert(!ImplicitlyConstructible<M, const KeyContainer<int>&>);
   }
   {
     // flat_set(container_type)
     // move-only
     MoveOnly expected[] = {3, 2, 1};
-    using Ks            = std::deque<MoveOnly, min_allocator<MoveOnly>>;
+    using Ks            = KeyContainer<MoveOnly, min_allocator<MoveOnly>>;
     using M             = std::flat_set<MoveOnly, std::greater<MoveOnly>, Ks>;
     Ks ks;
     ks.push_back(1);
@@ -87,8 +67,8 @@ void test() {
     // flat_set(container_type)
     // container's allocator is used
     using A = test_allocator<int>;
-    using M = std::flat_set<int, std::less<int>, std::deque<int, A>>;
-    auto ks = std::deque<int, A>({1, 1, 1, 2, 2, 3, 2, 3, 3}, A(5));
+    using M = std::flat_set<int, std::less<int>, KeyContainer<int, A>>;
+    auto ks = KeyContainer<int, A>({1, 1, 1, 2, 2, 3, 2, 3, 3}, A(5));
     auto m  = M(std::move(ks));
     assert(ks.empty()); // it was moved-from
     assert((m == M{1, 2, 3}));
@@ -97,22 +77,22 @@ void test() {
   }
   {
     // flat_set(container_type , key_compare)
-    using C             = test_less<int>;
-    using M             = std::flat_set<int, C>;
-    std::vector<int> ks = {1, 1, 1, 2, 2, 3, 2, 3, 3};
-    auto m              = M(ks, C(4));
+    using C              = test_less<int>;
+    using M              = std::flat_set<int, C, KeyContainer<int>>;
+    KeyContainer<int> ks = {1, 1, 1, 2, 2, 3, 2, 3, 3};
+    auto m               = M(ks, C(4));
     assert(std::ranges::equal(m, std::vector<int>{1, 2, 3}));
     assert(m.key_comp() == C(4));
 
     // explicit
-    static_assert(std::is_constructible_v<M, const std::vector<int>&, const C&>);
-    static_assert(!ImplicitlyConstructible<M, const std::vector<int>&, const C&>);
+    static_assert(std::is_constructible_v<M, const KeyContainer<int>&, const C&>);
+    static_assert(!ImplicitlyConstructible<M, const KeyContainer<int>&, const C&>);
   }
   {
     // flat_set(container_type , const Allocator&)
     using A = test_allocator<int>;
-    using M = std::flat_set<int, std::less<int>, std::deque<int, A>>;
-    auto ks = std::deque<int, A>({1, 1, 1, 2, 2, 3, 2, 3, 3}, A(5));
+    using M = std::flat_set<int, std::less<int>, KeyContainer<int, A>>;
+    auto ks = KeyContainer<int, A>({1, 1, 1, 2, 2, 3, 2, 3, 3}, A(5));
     auto m  = M(ks, A(4)); // replaces the allocators
     assert(!ks.empty());   // it was an lvalue above
     assert((m == M{1, 2, 3}));
@@ -120,7 +100,7 @@ void test() {
     assert(keys.get_allocator() == A(4));
 
     // explicit(false)
-    static_assert(ImplicitlyConstructible<M, const std::deque<int, A>&, const A&>);
+    static_assert(ImplicitlyConstructible<M, const KeyContainer<int, A>&, const A&>);
     M m2 = {ks, A(4)};   // implicit ctor
     assert(!ks.empty()); // it was an lvalue above
     assert(m2 == m);
@@ -129,11 +109,11 @@ void test() {
   }
   {
     // flat_set(container_type , key_compare, const Allocator&)
-    using C                = test_less<int>;
-    using A                = test_allocator<int>;
-    using M                = std::flat_set<int, C, std::vector<int, A>>;
-    std::vector<int, A> ks = {1, 1, 1, 2, 2, 3, 2, 3, 3};
-    auto m                 = M(ks, C(4), A(5));
+    using C                 = test_less<int>;
+    using A                 = test_allocator<int>;
+    using M                 = std::flat_set<int, C, KeyContainer<int, A>>;
+    KeyContainer<int, A> ks = {1, 1, 1, 2, 2, 3, 2, 3, 3};
+    auto m                  = M(ks, C(4), A(5));
     assert(std::ranges::equal(m, std::vector<int, A>{1, 2, 3}));
     assert(m.key_comp() == C(4));
     auto m_copy = m;
@@ -141,7 +121,7 @@ void test() {
     assert(keys.get_allocator() == A(5));
 
     // explicit(false)
-    static_assert(ImplicitlyConstructible<M, const std::vector<int, A>&, const A&>);
+    static_assert(ImplicitlyConstructible<M, const KeyContainer<int, A>&, const A&>);
     M m2 = {ks, C(4), A(5)};
     assert(m2 == m);
     assert(m2.key_comp() == C(4));
@@ -150,8 +130,44 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  {
+    // The constructors in this subclause shall not participate in overload
+    // resolution unless uses_allocator_v<container_type, Alloc> is true.
+
+    using C  = test_less<int>;
+    using A1 = test_allocator<int>;
+    using A2 = other_allocator<int>;
+    using V1 = std::vector<int, A1>;
+    using V2 = std::vector<int, A2>;
+    using M1 = std::flat_set<int, C, V1>;
+    using M2 = std::flat_set<int, C, V2>;
+    static_assert(std::is_constructible_v<M1, const V1&, const A1&>);
+    static_assert(std::is_constructible_v<M2, const V2&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, const V1&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, const V2&, const A1&>);
+
+    static_assert(std::is_constructible_v<M1, const V1&, const C&, const A1&>);
+    static_assert(std::is_constructible_v<M2, const V2&, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, const V1&, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, const V2&, const C&, const A1&>);
+  }
+
+  test<std::vector>();
+
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/copy.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy.pass.cpp
index 1ba550d98f01f..343725c294971 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy.pass.cpp
@@ -14,6 +14,7 @@
 
 #include <algorithm>
 #include <cassert>
+#include <deque>
 #include <flat_set>
 #include <vector>
 
@@ -21,10 +22,11 @@
 #include "../../../test_compare.h"
 #include "test_allocator.h"
 
-void test() {
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
     using C = test_less<int>;
-    std::vector<int, test_allocator<int>> ks({1, 3, 5}, test_allocator<int>(6));
+    KeyContainer<int, test_allocator<int>> ks({1, 3, 5}, test_allocator<int>(6));
     using M = std::flat_set<int, C, decltype(ks)>;
     auto mo = M(ks, C(5));
     auto m  = mo;
@@ -42,7 +44,7 @@ void test() {
   }
   {
     using C  = test_less<int>;
-    using Ks = std::vector<int, other_allocator<int>>;
+    using Ks = KeyContainer<int, other_allocator<int>>;
     auto ks  = Ks({1, 3, 5}, other_allocator<int>(6));
     using M  = std::flat_set<int, C, Ks>;
     auto mo  = M(Ks(ks, other_allocator<int>(6)), C(5));
@@ -61,8 +63,21 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/copy_alloc.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_alloc.pass.cpp
index 5011bd2003064..779d0f8132708 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_alloc.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_alloc.pass.cpp
@@ -23,7 +23,27 @@
 #include "../../../test_compare.h"
 #include "test_allocator.h"
 
-void test() {
+template <template <class...> class KeyContainer>
+constexpr void test() {
+  using C = test_less<int>;
+  KeyContainer<int, test_allocator<int>> ks({1, 3, 5}, test_allocator<int>(6));
+  using M = std::flat_set<int, C, decltype(ks)>;
+  auto mo = M(ks, C(5));
+  auto m  = M(mo, test_allocator<int>(3));
+
+  assert(m.key_comp() == C(5));
+  assert(std::ranges::equal(m, ks));
+  auto keys = std::move(m).extract();
+  assert(keys.get_allocator() == test_allocator<int>(3));
+
+  // mo is unchanged
+  assert(mo.key_comp() == C(5));
+  assert(std::ranges::equal(mo, ks));
+  auto keys2 = std::move(mo).extract();
+  assert(keys2.get_allocator() == test_allocator<int>(6));
+}
+
+constexpr bool test() {
   {
     // The constructors in this subclause shall not participate in overload
     // resolution unless uses_allocator_v<container_type, Alloc> is true.
@@ -40,28 +60,21 @@ void test() {
     static_assert(!std::is_constructible_v<M1, const M1&, const A2&>);
     static_assert(!std::is_constructible_v<M2, const M2&, const A1&>);
   }
-  {
-    using C = test_less<int>;
-    std::vector<int, test_allocator<int>> ks({1, 3, 5}, test_allocator<int>(6));
-    using M = std::flat_set<int, C, decltype(ks)>;
-    auto mo = M(ks, C(5));
-    auto m  = M(mo, test_allocator<int>(3));
 
-    assert(m.key_comp() == C(5));
-    assert(std::ranges::equal(m, ks));
-    auto keys = std::move(m).extract();
-    assert(keys.get_allocator() == test_allocator<int>(3));
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
 
-    // mo is unchanged
-    assert(mo.key_comp() == C(5));
-    assert(std::ranges::equal(mo, ks));
-    auto keys2 = std::move(mo).extract();
-    assert(keys2.get_allocator() == test_allocator<int>(6));
-  }
+  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/container.adaptors/flat.set/flat.set.cons/copy_assign.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_assign.pass.cpp
index 695363e3aeaba..0a43c3c03aa39 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_assign.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_assign.pass.cpp
@@ -13,6 +13,7 @@
 // flat_set& operator=(const flat_set& m);
 
 #include <algorithm>
+#include <deque>
 #include <flat_set>
 #include <functional>
 #include <vector>
@@ -22,11 +23,12 @@
 #include "../../../test_compare.h"
 #include "test_allocator.h"
 
-void test() {
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
     // test_allocator is not propagated
     using C = test_less<int>;
-    std::vector<int, test_allocator<int>> ks({1, 3, 5}, test_allocator<int>(6));
+    KeyContainer<int, test_allocator<int>> ks({1, 3, 5}, test_allocator<int>(6));
     using M = std::flat_set<int, C, decltype(ks)>;
     auto mo = M(ks, C(5));
     auto m  = M({{3, 4, 5}}, C(3), test_allocator<int>(2));
@@ -46,7 +48,7 @@ void test() {
   {
     // other_allocator is propagated
     using C  = test_less<int>;
-    using Ks = std::vector<int, other_allocator<int>>;
+    using Ks = KeyContainer<int, other_allocator<int>>;
     auto ks  = Ks({1, 3, 5}, other_allocator<int>(6));
     using M  = std::flat_set<int, C, Ks>;
     auto mo  = M(Ks(ks, other_allocator<int>(6)), C(5));
@@ -64,9 +66,9 @@ void test() {
     auto keys2 = std::move(mo).extract();
     assert(keys2.get_allocator() == other_allocator<int>(6));
   }
-  {
+  if (!std::is_constant_evaluated()) {
     // comparator is copied and invariant is preserved
-    using M = std::flat_set<int, std::function<bool(int, int)>>;
+    using M = std::flat_set<int, std::function<bool(int, int)>, KeyContainer<int>>;
     M mo    = M({1, 2}, std::less<int>());
     M m     = M({1, 2}, std::greater<int>());
     assert(m.key_comp()(2, 1) == true);
@@ -77,7 +79,7 @@ void test() {
   }
   {
     // self-assignment
-    using M = std::flat_set<int>;
+    using M = std::flat_set<int, std::less<int>, KeyContainer<int>>;
     M m     = {{1, 2}};
     m       = static_cast<const M&>(m);
     assert((m == M{{1, 2}}));
@@ -93,8 +95,21 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/default.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/default.pass.cpp
index 5cbd557eb8562..c7ab9d20f999b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/default.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/default.pass.cpp
@@ -25,28 +25,29 @@
 #include "test_macros.h"
 
 struct DefaultCtableComp {
-  explicit DefaultCtableComp() { default_constructed_ = true; }
-  bool operator()(int, int) const { return false; }
+  constexpr explicit DefaultCtableComp() { default_constructed_ = true; }
+  constexpr bool operator()(int, int) const { return false; }
   bool default_constructed_ = false;
 };
 
 struct ThrowingCtorComp {
-  ThrowingCtorComp() noexcept(false) {}
-  bool operator()(const auto&, const auto&) const { return false; }
+  constexpr ThrowingCtorComp() noexcept(false) {}
+  constexpr bool operator()(const auto&, const auto&) const { return false; }
 };
 
-void test() {
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
-    std::flat_set<int> m;
+    std::flat_set<int, std::less<int>, KeyContainer<int>> m;
     assert(m.empty());
   }
   {
     // explicit(false)
-    std::flat_set<int> m = {};
+    std::flat_set<int, std::less<int>, KeyContainer<int>> m = {};
     assert(m.empty());
   }
   {
-    std::flat_set<int, DefaultCtableComp, std::deque<int, min_allocator<int>>> m;
+    std::flat_set<int, DefaultCtableComp, KeyContainer<int, min_allocator<int>>> m;
     assert(m.empty());
     assert(m.begin() == m.end());
     assert(m.key_comp().default_constructed_);
@@ -54,43 +55,56 @@ void test() {
   {
     using A1 = explicit_allocator<int>;
     {
-      std::flat_set<int, DefaultCtableComp, std::vector<int, A1>> m;
+      std::flat_set<int, DefaultCtableComp, KeyContainer<int, A1>> m;
       assert(m.empty());
       assert(m.key_comp().default_constructed_);
     }
     {
       A1 a1;
-      std::flat_set<int, DefaultCtableComp, std::vector<int, A1>> m(a1);
+      std::flat_set<int, DefaultCtableComp, KeyContainer<int, A1>> m(a1);
       assert(m.empty());
       assert(m.key_comp().default_constructed_);
     }
   }
 #if defined(_LIBCPP_VERSION)
   {
-    using C = std::flat_set<MoveOnly>;
+    using C = std::flat_set<MoveOnly, std::less<MoveOnly>, KeyContainer<MoveOnly>>;
     static_assert(std::is_nothrow_default_constructible_v<C>);
     C c;
   }
   {
-    using C = std::flat_set<MoveOnly, std::less<MoveOnly>, std::vector<MoveOnly, test_allocator<MoveOnly>>>;
+    using C = std::flat_set<MoveOnly, std::less<MoveOnly>, KeyContainer<MoveOnly, test_allocator<MoveOnly>>>;
     static_assert(std::is_nothrow_default_constructible_v<C>);
     C c;
   }
 #endif // _LIBCPP_VERSION
   {
-    using C = std::flat_set<MoveOnly, std::less<MoveOnly>, std::vector<MoveOnly, other_allocator<MoveOnly>>>;
+    using C = std::flat_set<MoveOnly, std::less<MoveOnly>, KeyContainer<MoveOnly, other_allocator<MoveOnly>>>;
     static_assert(!std::is_nothrow_default_constructible_v<C>);
     C c;
   }
   {
-    using C = std::flat_set<MoveOnly, ThrowingCtorComp>;
+    using C = std::flat_set<MoveOnly, ThrowingCtorComp, KeyContainer<MoveOnly>>;
     static_assert(!std::is_nothrow_default_constructible_v<C>);
     C c;
   }
 }
 
+constexpr bool test() {
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/dtor_noexcept.pass.cpp
index fa1e2478af459..f7a8f8719c22f 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/dtor_noexcept.pass.cpp
@@ -23,39 +23,53 @@
 #include "test_allocator.h"
 
 struct ThrowingDtorComp {
-  bool operator()(const auto&, const auto&) const;
-  ~ThrowingDtorComp() noexcept(false) {}
+  constexpr bool operator()(const auto&, const auto&) const;
+  constexpr ~ThrowingDtorComp() noexcept(false) {}
 };
 
-void test() {
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
-    using C = std::flat_set<MoveOnly, MoveOnly>;
+    using C = std::flat_set<MoveOnly, std::less<MoveOnly>, KeyContainer<MoveOnly>>;
     static_assert(std::is_nothrow_destructible_v<C>);
     C c;
   }
   {
-    using V = std::vector<MoveOnly, test_allocator<MoveOnly>>;
+    using V = KeyContainer<MoveOnly, test_allocator<MoveOnly>>;
     using C = std::flat_set<MoveOnly, std::less<MoveOnly>, V>;
     static_assert(std::is_nothrow_destructible_v<C>);
     C c;
   }
   {
-    using V = std::deque<MoveOnly, other_allocator<MoveOnly>>;
+    using V = KeyContainer<MoveOnly, other_allocator<MoveOnly>>;
     using C = std::flat_set<MoveOnly, std::greater<MoveOnly>, V>;
     static_assert(std::is_nothrow_destructible_v<C>);
     C c;
   }
 #if defined(_LIBCPP_VERSION)
   {
-    using C = std::flat_set<MoveOnly, ThrowingDtorComp>;
+    using C = std::flat_set<MoveOnly, ThrowingDtorComp, KeyContainer<MoveOnly>>;
     static_assert(!std::is_nothrow_destructible_v<C>);
     C c;
   }
 #endif // _LIBCPP_VERSION
 }
 
+constexpr bool test() {
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/initializer_list.pass.cpp
index 9aed5c88ee726..55eabcee578c3 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/initializer_list.pass.cpp
@@ -30,57 +30,17 @@
 #include "../../../test_compare.h"
 
 struct DefaultCtableComp {
-  explicit DefaultCtableComp() { default_constructed_ = true; }
-  bool operator()(int, int) const { return false; }
+  constexpr explicit DefaultCtableComp() { default_constructed_ = true; }
+  constexpr bool operator()(int, int) const { return false; }
   bool default_constructed_ = false;
 };
 
-void test() {
-  {
-    // The constructors in this subclause shall not participate in overload
-    // resolution unless uses_allocator_v<container_type, Alloc> is true.
-
-    using C  = test_less<int>;
-    using A1 = test_allocator<int>;
-    using A2 = other_allocator<int>;
-    using V1 = std::vector<int, A1>;
-    using V2 = std::vector<int, A2>;
-    using M1 = std::flat_set<int, C, V1>;
-    using M2 = std::flat_set<int, C, V2>;
-    using IL = std::initializer_list<int>;
-    static_assert(std::is_constructible_v<M1, IL, const A1&>);
-    static_assert(std::is_constructible_v<M2, IL, const A2&>);
-    static_assert(!std::is_constructible_v<M1, IL, const A2&>);
-    static_assert(!std::is_constructible_v<M2, IL, const A1&>);
-
-    static_assert(std::is_constructible_v<M1, IL, const C&, const A1&>);
-    static_assert(std::is_constructible_v<M2, IL, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, IL, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, IL, const C&, const A1&>);
-  }
-
-  {
-    // initializer_list<value_type> needs to match exactly
-    using M = std::flat_set<int>;
-    using C = typename M::key_compare;
-    static_assert(std::is_constructible_v<M, std::initializer_list<int>>);
-    static_assert(std::is_constructible_v<M, std::initializer_list<int>, C>);
-    static_assert(std::is_constructible_v<M, std::initializer_list<int>, C, std::allocator<int>>);
-    static_assert(std::is_constructible_v<M, std::initializer_list<int>, std::allocator<int>>);
-    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>>);
-    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, C>);
-    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, C, std::allocator<int>>);
-    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, std::allocator<int>>);
-    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>>);
-    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, C>);
-    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, C, std::allocator<int>>);
-    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, std::allocator<int>>);
-  }
-
+template <template <class...> class KeyContainer>
+constexpr void test() {
   int expected[] = {1, 2, 3, 5};
   {
     // flat_set(initializer_list<value_type>);
-    using M                       = std::flat_set<int>;
+    using M                       = std::flat_set<int, std::less<int>, KeyContainer<int>>;
     std::initializer_list<int> il = {5, 2, 2, 3, 1, 3};
     M m(il);
     assert(std::equal(m.begin(), m.end(), expected, expected + 4));
@@ -88,13 +48,13 @@ void test() {
   {
     // flat_set(initializer_list<value_type>);
     // explicit(false)
-    using M = std::flat_set<int>;
+    using M = std::flat_set<int, std::less<int>, KeyContainer<int>>;
     M m     = {5, 2, 2, 3, 1, 3};
     assert(std::equal(m.begin(), m.end(), expected, expected + 4));
   }
   {
     // flat_set(initializer_list<value_type>);
-    using M = std::flat_set<int, std::greater<int>, std::deque<int, min_allocator<int>>>;
+    using M = std::flat_set<int, std::greater<int>, KeyContainer<int, min_allocator<int>>>;
     M m     = {5, 2, 2, 3, 1, 3};
     assert(std::equal(m.rbegin(), m.rend(), expected, expected + 4));
   }
@@ -103,15 +63,14 @@ void test() {
     {
       // flat_set(initializer_list<value_type>);
       // different comparator
-      using M = std::flat_set<int, DefaultCtableComp, std::vector<int, A>>;
+      using M = std::flat_set<int, DefaultCtableComp, KeyContainer<int, A>>;
       M m     = {1, 2, 3};
       assert(m.size() == 1);
-      LIBCPP_ASSERT(*m.begin() == 1);
       assert(m.key_comp().default_constructed_);
     }
     {
       // flat_set(initializer_list<value_type>, const Allocator&);
-      using M = std::flat_set<int, std::greater<int>, std::deque<int, A>>;
+      using M = std::flat_set<int, std::greater<int>, KeyContainer<int, A>>;
       A a;
       M m({5, 2, 2, 3, 1, 3}, a);
       assert(std::equal(m.rbegin(), m.rend(), expected, expected + 4));
@@ -120,7 +79,7 @@ void test() {
   {
     // flat_set(initializer_list<value_type>, const key_compare&);
     using C = test_less<int>;
-    using M = std::flat_set<int, C>;
+    using M = std::flat_set<int, C, KeyContainer<int>>;
     auto m  = M({5, 2, 2, 3, 1, 3}, C(10));
     assert(std::equal(m.begin(), m.end(), expected, expected + 4));
     assert(m.key_comp() == C(10));
@@ -130,10 +89,10 @@ void test() {
     assert(m2 == m);
     assert(m2.key_comp() == C(10));
   }
-  {
+  if (!std::is_constant_evaluated()) {
     // flat_set(initializer_list<value_type>, const key_compare&);
     // Sorting uses the comparator that was passed in
-    using M = std::flat_set<int, std::function<bool(int, int)>, std::deque<int, min_allocator<int>>>;
+    using M = std::flat_set<int, std::function<bool(int, int)>, KeyContainer<int, min_allocator<int>>>;
     auto m  = M({5, 2, 2, 1, 3, 1}, std::greater<int>());
     assert(std::equal(m.rbegin(), m.rend(), expected, expected + 4));
     assert(m.key_comp()(2, 1) == true);
@@ -141,15 +100,69 @@ void test() {
   {
     // flat_set(initializer_list<value_type> il, const key_compare& comp, const Alloc& a);
     using A = explicit_allocator<int>;
-    using M = std::flat_set<int, std::greater<int>, std::deque<int, A>>;
+    using M = std::flat_set<int, std::greater<int>, KeyContainer<int, A>>;
     A a;
     M m({5, 2, 2, 3, 1, 3}, {}, a);
     assert(std::equal(m.rbegin(), m.rend(), expected, expected + 4));
   }
 }
 
+constexpr bool test() {
+  {
+    // The constructors in this subclause shall not participate in overload
+    // resolution unless uses_allocator_v<container_type, Alloc> is true.
+
+    using C  = test_less<int>;
+    using A1 = test_allocator<int>;
+    using A2 = other_allocator<int>;
+    using V1 = std::vector<int, A1>;
+    using V2 = std::vector<int, A2>;
+    using M1 = std::flat_set<int, C, V1>;
+    using M2 = std::flat_set<int, C, V2>;
+    using IL = std::initializer_list<int>;
+    static_assert(std::is_constructible_v<M1, IL, const A1&>);
+    static_assert(std::is_constructible_v<M2, IL, const A2&>);
+    static_assert(!std::is_constructible_v<M1, IL, const A2&>);
+    static_assert(!std::is_constructible_v<M2, IL, const A1&>);
+
+    static_assert(std::is_constructible_v<M1, IL, const C&, const A1&>);
+    static_assert(std::is_constructible_v<M2, IL, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, IL, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, IL, const C&, const A1&>);
+  }
+
+  {
+    // initializer_list<value_type> needs to match exactly
+    using M = std::flat_set<int>;
+    using C = typename M::key_compare;
+    static_assert(std::is_constructible_v<M, std::initializer_list<int>>);
+    static_assert(std::is_constructible_v<M, std::initializer_list<int>, C>);
+    static_assert(std::is_constructible_v<M, std::initializer_list<int>, C, std::allocator<int>>);
+    static_assert(std::is_constructible_v<M, std::initializer_list<int>, std::allocator<int>>);
+    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>>);
+    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, C>);
+    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, C, std::allocator<int>>);
+    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, std::allocator<int>>);
+    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>>);
+    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, C>);
+    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, C, std::allocator<int>>);
+    static_assert(!std::is_constructible_v<M, std::initializer_list<const int>, std::allocator<int>>);
+  }
+
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/iter_iter.pass.cpp
index 2d0b07c9155fd..4d64e560ce231 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/iter_iter.pass.cpp
@@ -23,43 +23,21 @@
 #include <functional>
 #include <vector>
 
+#include "MinSequenceContainer.h"
 #include "min_allocator.h"
 #include "test_allocator.h"
 #include "test_iterators.h"
 #include "test_macros.h"
 #include "../../../test_compare.h"
 
-void test() {
-  {
-    // The constructors in this subclause shall not participate in overload
-    // resolution unless uses_allocator_v<container_type, Alloc> is true.
-
-    using C     = test_less<int>;
-    using A1    = test_allocator<int>;
-    using A2    = other_allocator<int>;
-    using V1    = std::vector<int, A1>;
-    using V2    = std::vector<int, A2>;
-    using M1    = std::flat_set<int, C, V1>;
-    using M2    = std::flat_set<int, C, V2>;
-    using Iter1 = typename M1::iterator;
-    using Iter2 = typename M2::iterator;
-    static_assert(std::is_constructible_v<M1, Iter1, Iter1, const A1&>);
-    static_assert(std::is_constructible_v<M2, Iter2, Iter2, const A2&>);
-    static_assert(!std::is_constructible_v<M1, Iter1, Iter1, const A2&>);
-    static_assert(!std::is_constructible_v<M2, Iter2, Iter2, const A1&>);
-
-    static_assert(std::is_constructible_v<M1, Iter1, Iter1, const C&, const A1&>);
-    static_assert(std::is_constructible_v<M2, Iter2, Iter2, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, Iter1, Iter1, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, Iter2, Iter2, const C&, const A1&>);
-  }
-
+template <class KeyContainer>
+constexpr void test() {
   int ar[]       = {1, 1, 1, 2, 2, 3, 2, 3, 3};
   int expected[] = {1, 2, 3};
   {
     // flat_set(InputIterator , InputIterator)
     // cpp17_input_iterator
-    using M = std::flat_set<int>;
+    using M = std::flat_set<int, std::less<int>, KeyContainer>;
     auto m  = M(cpp17_input_iterator<const int*>(ar), cpp17_input_iterator<const int*>(ar + 9));
     assert(std::ranges::equal(m, expected));
 
@@ -70,21 +48,21 @@ void test() {
   {
     // flat_set(InputIterator , InputIterator)
     // greater
-    using M = std::flat_set<int, std::greater<int>, std::deque<int, min_allocator<int>>>;
+    using M = std::flat_set<int, std::greater<int>, KeyContainer>;
     auto m  = M(cpp17_input_iterator<const int*>(ar), cpp17_input_iterator<const int*>(ar + 9));
-    assert(std::ranges::equal(m, std::deque<int, min_allocator<int>>{3, 2, 1}));
+    assert(std::ranges::equal(m, KeyContainer{3, 2, 1}));
   }
   {
     // flat_set(InputIterator , InputIterator)
     // Test when the operands are of array type (also contiguous iterator type)
-    using M = std::flat_set<int, std::greater<int>, std::vector<int, min_allocator<int>>>;
+    using M = std::flat_set<int, std::greater<int>, KeyContainer>;
     auto m  = M(ar, ar);
     assert(m.empty());
   }
   {
     // flat_set(InputIterator , InputIterator, const key_compare&)
     using C = test_less<int>;
-    using M = std::flat_set<int, C, std::vector<int>>;
+    using M = std::flat_set<int, C, KeyContainer>;
     auto m  = M(ar, ar + 9, C(3));
     assert(std::ranges::equal(m, expected));
     assert(m.key_comp() == C(3));
@@ -94,10 +72,17 @@ void test() {
     assert(m2 == m);
     assert(m2.key_comp() == C(3));
   }
+}
+
+template <template <class...> class KeyContainer>
+constexpr void test_alloc() {
+  int ar[]       = {1, 1, 1, 2, 2, 3, 2, 3, 3};
+  int expected[] = {1, 2, 3};
+
   {
     // flat_set(InputIterator , InputIterator, const Allocator&)
     using A1 = test_allocator<int>;
-    using M  = std::flat_set<int, std::less<int>, std::vector<int, A1>>;
+    using M  = std::flat_set<int, std::less<int>, KeyContainer<int, A1>>;
     auto m   = M(ar, ar + 9, A1(5));
     assert(std::ranges::equal(m, expected));
     assert(std::move(m).extract().get_allocator() == A1(5));
@@ -106,7 +91,7 @@ void test() {
     // flat_set(InputIterator , InputIterator, const Allocator&)
     // explicit(false)
     using A1 = test_allocator<int>;
-    using M  = std::flat_set<int, std::less<int>, std::vector<int, A1>>;
+    using M  = std::flat_set<int, std::less<int>, KeyContainer<int, A1>>;
     M m      = {ar, ar + 9, A1(5)}; // implicit ctor
     assert(std::ranges::equal(m, expected));
     assert(std::move(m).extract().get_allocator() == A1(5));
@@ -115,7 +100,7 @@ void test() {
     // flat_set(InputIterator , InputIterator, const key_compare&, const Allocator&)
     using C  = test_less<int>;
     using A1 = test_allocator<int>;
-    using M  = std::flat_set<int, C, std::vector<int, A1>>;
+    using M  = std::flat_set<int, C, KeyContainer<int, A1>>;
     auto m   = M(ar, ar + 9, C(3), A1(5));
     assert(std::ranges::equal(m, expected));
     assert(m.key_comp() == C(3));
@@ -125,7 +110,7 @@ void test() {
     // flat_set(InputIterator , InputIterator, const key_compare&, const Allocator&)
     // explicit(false)
     using A1 = test_allocator<int>;
-    using M  = std::flat_set<int, std::less<int>, std::deque<int, A1>>;
+    using M  = std::flat_set<int, std::less<int>, KeyContainer<int, A1>>;
     M m      = {ar, ar + 9, {}, A1(5)}; // implicit ctor
     assert(std::ranges::equal(m, expected));
     LIBCPP_ASSERT(std::ranges::equal(m, expected));
@@ -133,8 +118,53 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  {
+    // The constructors in this subclause shall not participate in overload
+    // resolution unless uses_allocator_v<container_type, Alloc> is true.
+
+    using C     = test_less<int>;
+    using A1    = test_allocator<int>;
+    using A2    = other_allocator<int>;
+    using V1    = std::vector<int, A1>;
+    using V2    = std::vector<int, A2>;
+    using M1    = std::flat_set<int, C, V1>;
+    using M2    = std::flat_set<int, C, V2>;
+    using Iter1 = typename M1::iterator;
+    using Iter2 = typename M2::iterator;
+    static_assert(std::is_constructible_v<M1, Iter1, Iter1, const A1&>);
+    static_assert(std::is_constructible_v<M2, Iter2, Iter2, const A2&>);
+    static_assert(!std::is_constructible_v<M1, Iter1, Iter1, const A2&>);
+    static_assert(!std::is_constructible_v<M2, Iter2, Iter2, const A1&>);
+
+    static_assert(std::is_constructible_v<M1, Iter1, Iter1, const C&, const A1&>);
+    static_assert(std::is_constructible_v<M2, Iter2, Iter2, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, Iter1, Iter1, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, Iter2, Iter2, const C&, const A1&>);
+  }
+
+  test<std::vector<int>>();
+  test<MinSequenceContainer<int>>();
+  test<std::vector<int, min_allocator<int>>>();
+
+  test_alloc<std::vector>();
+
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+  {
+    test<std::deque<int>>();
+    test_alloc<std::deque>();
+  }
+
+  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/container.adaptors/flat.set/flat.set.cons/move.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move.pass.cpp
index e26f8c8f25ce1..17c4b3550a784 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move.pass.cpp
@@ -25,11 +25,12 @@
 #include "test_allocator.h"
 #include "min_allocator.h"
 
-void test() {
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
     using C = test_less<int>;
     using A = test_allocator<int>;
-    using M = std::flat_set<int, C, std::deque<int, A>>;
+    using M = std::flat_set<int, C, KeyContainer<int, A>>;
     M mo    = M({1, 2, 3}, C(5), A(7));
     M m     = std::move(mo);
     assert((m == M{1, 2, 3}));
@@ -43,7 +44,7 @@ void test() {
   {
     using C = test_less<int>;
     using A = min_allocator<int>;
-    using M = std::flat_set<int, C, std::vector<int, A>>;
+    using M = std::flat_set<int, C, KeyContainer<int, A>>;
     M mo    = M({1, 2, 3}, C(5), A());
     M m     = std::move(mo);
     assert((m == M{1, 2, 3}));
@@ -54,9 +55,9 @@ void test() {
     assert(mo.key_comp() == C(5));
     assert(std::move(mo).extract().get_allocator() == A());
   }
-  {
+  if (!std::is_constant_evaluated()) {
     // A moved-from flat_set maintains its class invariant in the presence of moved-from comparators.
-    using M = std::flat_set<int, std::function<bool(int, int)>>;
+    using M = std::flat_set<int, std::function<bool(int, int)>, KeyContainer<int>>;
     M mo    = M({1, 2, 3}, std::less<int>());
     M m     = std::move(mo);
     assert(m.size() == 3);
@@ -86,47 +87,35 @@ struct ThrowingMoveAllocator {
   using value_type                                    = T;
   explicit ThrowingMoveAllocator()                    = default;
   ThrowingMoveAllocator(const ThrowingMoveAllocator&) = default;
-  ThrowingMoveAllocator(ThrowingMoveAllocator&&) noexcept(false) {}
-  T* allocate(std::ptrdiff_t n) { return std::allocator<T>().allocate(n); }
-  void deallocate(T* p, std::ptrdiff_t n) { return std::allocator<T>().deallocate(p, n); }
+  constexpr ThrowingMoveAllocator(ThrowingMoveAllocator&&) noexcept(false) {}
+  constexpr T* allocate(std::ptrdiff_t n) { return std::allocator<T>().allocate(n); }
+  constexpr void deallocate(T* p, std::ptrdiff_t n) { return std::allocator<T>().deallocate(p, n); }
   friend bool operator==(ThrowingMoveAllocator, ThrowingMoveAllocator) = default;
 };
 
 struct ThrowingMoveComp {
   ThrowingMoveComp() = default;
-  ThrowingMoveComp(const ThrowingMoveComp&) noexcept(true) {}
-  ThrowingMoveComp(ThrowingMoveComp&&) noexcept(false) {}
-  bool operator()(const auto&, const auto&) const { return false; }
-};
-
-struct MoveSensitiveComp {
-  MoveSensitiveComp() noexcept(false)                  = default;
-  MoveSensitiveComp(const MoveSensitiveComp&) noexcept = default;
-  MoveSensitiveComp(MoveSensitiveComp&& rhs) { rhs.is_moved_from_ = true; }
-  MoveSensitiveComp& operator=(const MoveSensitiveComp&) noexcept(false) = default;
-  MoveSensitiveComp& operator=(MoveSensitiveComp&& rhs) {
-    rhs.is_moved_from_ = true;
-    return *this;
-  }
-  bool operator()(const auto&, const auto&) const { return false; }
-  bool is_moved_from_ = false;
+  constexpr ThrowingMoveComp(const ThrowingMoveComp&) noexcept(true) {}
+  constexpr ThrowingMoveComp(ThrowingMoveComp&&) noexcept(false) {}
+  constexpr bool operator()(const auto&, const auto&) const { return false; }
 };
 
-void test_move_noexcept() {
+template <template <class...> class KeyContainer>
+constexpr void test_move_noexcept() {
   {
-    using C = std::flat_set<int>;
+    using C = std::flat_set<int, std::less<int>, KeyContainer<int>>;
     LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible_v<C>);
     C c;
     C d = std::move(c);
   }
   {
-    using C = std::flat_set<int, std::less<int>, std::deque<int, test_allocator<int>>>;
+    using C = std::flat_set<int, std::less<int>, KeyContainer<int, test_allocator<int>>>;
     LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible_v<C>);
     C c;
     C d = std::move(c);
   }
 #if _LIBCPP_VERSION
-  {
+  if (!std::is_constant_evaluated()) {
     // Container fails to be nothrow-move-constructible; this relies on libc++'s support for non-nothrow-copyable allocators
     using C = std::flat_set<int, std::less<int>, std::deque<int, ThrowingMoveAllocator<int>>>;
     static_assert(!std::is_nothrow_move_constructible_v<std::deque<int, ThrowingMoveAllocator<int>>>);
@@ -137,13 +126,26 @@ void test_move_noexcept() {
 #endif // _LIBCPP_VERSION
   {
     // Comparator fails to be nothrow-move-constructible
-    using C = std::flat_set<int, ThrowingMoveComp>;
+    using C = std::flat_set<int, ThrowingMoveComp, KeyContainer<int>>;
     static_assert(!std::is_nothrow_move_constructible_v<C>);
     C c;
     C d = std::move(c);
   }
 }
 
+constexpr bool test() {
+  test<std::vector>();
+  test_move_noexcept<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+  {
+    test<std::deque>();
+    test_move_noexcept<std::deque>();
+  }
+  return true;
+}
+
 #if !defined(TEST_HAS_NO_EXCEPTIONS)
 static int countdown = 0;
 
@@ -179,10 +181,12 @@ void test_move_exception() {
 
 int main(int, char**) {
   test();
-  test_move_noexcept();
 #if !defined(TEST_HAS_NO_EXCEPTIONS)
   test_move_exception();
 #endif
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_alloc.pass.cpp
index 489b6ff36324b..a2253208422d5 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_alloc.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_alloc.pass.cpp
@@ -24,28 +24,13 @@
 #include "../../../test_compare.h"
 #include "test_allocator.h"
 
-void test() {
-  {
-    // The constructors in this subclause shall not participate in overload
-    // resolution unless uses_allocator_v<container_type, Alloc> is true.
-
-    using C  = test_less<int>;
-    using A1 = test_allocator<int>;
-    using A2 = other_allocator<int>;
-    using V1 = std::vector<int, A1>;
-    using V2 = std::vector<int, A2>;
-    using M1 = std::flat_set<int, C, V1>;
-    using M2 = std::flat_set<int, C, V2>;
-    static_assert(std::is_constructible_v<M1, M1&&, const A1&>);
-    static_assert(std::is_constructible_v<M2, M2&&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, M1&&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, M2&&, const A1&>);
-  }
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
     int expected[] = {1, 2, 3};
     using C        = test_less<int>;
     using A        = test_allocator<int>;
-    using M        = std::flat_set<int, C, std::deque<int, A>>;
+    using M        = std::flat_set<int, C, KeyContainer<int, A>>;
     auto mo        = M(expected, expected + 3, C(5), A(7));
     auto m         = M(std::move(mo), A(3));
 
@@ -72,8 +57,38 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  {
+    // The constructors in this subclause shall not participate in overload
+    // resolution unless uses_allocator_v<container_type, Alloc> is true.
+
+    using C  = test_less<int>;
+    using A1 = test_allocator<int>;
+    using A2 = other_allocator<int>;
+    using V1 = std::vector<int, A1>;
+    using V2 = std::vector<int, A2>;
+    using M1 = std::flat_set<int, C, V1>;
+    using M2 = std::flat_set<int, C, V2>;
+    static_assert(std::is_constructible_v<M1, M1&&, const A1&>);
+    static_assert(std::is_constructible_v<M2, M2&&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, M1&&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, M2&&, const A1&>);
+  }
+
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/move_assign.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_assign.pass.cpp
index 0e0ab0aa135f9..f54acea41e3c7 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_assign.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_assign.pass.cpp
@@ -30,9 +30,9 @@
 struct MoveNegates {
   int value_    = 0;
   MoveNegates() = default;
-  MoveNegates(int v) : value_(v) {}
-  MoveNegates(MoveNegates&& rhs) : value_(rhs.value_) { rhs.value_ = -rhs.value_; }
-  MoveNegates& operator=(MoveNegates&& rhs) {
+  constexpr MoveNegates(int v) : value_(v) {}
+  constexpr MoveNegates(MoveNegates&& rhs) : value_(rhs.value_) { rhs.value_ = -rhs.value_; }
+  constexpr MoveNegates& operator=(MoveNegates&& rhs) {
     value_     = rhs.value_;
     rhs.value_ = -rhs.value_;
     return *this;
@@ -44,9 +44,9 @@ struct MoveNegates {
 struct MoveClears {
   int value_   = 0;
   MoveClears() = default;
-  MoveClears(int v) : value_(v) {}
-  MoveClears(MoveClears&& rhs) : value_(rhs.value_) { rhs.value_ = 0; }
-  MoveClears& operator=(MoveClears&& rhs) {
+  constexpr MoveClears(int v) : value_(v) {}
+  constexpr MoveClears(MoveClears&& rhs) : value_(rhs.value_) { rhs.value_ = 0; }
+  constexpr MoveClears& operator=(MoveClears&& rhs) {
     value_     = rhs.value_;
     rhs.value_ = 0;
     return *this;
@@ -68,11 +68,12 @@ struct MoveAssignThrows : std::vector<int> {
 };
 #endif // TEST_HAS_NO_EXCEPTIONS
 
-void test_move_assign_clears() {
+template <template <class...> class KeyContainer>
+constexpr void test_move_assign_clears() {
   // Preserves the class invariant for the moved-from flat_set.
   {
     const int expected[] = {1, 2, 3, 4, 5, 6, 7, 8};
-    using M              = std::flat_set<MoveNegates, std::less<MoveNegates>>;
+    using M              = std::flat_set<MoveNegates, std::less<MoveNegates>, KeyContainer<MoveNegates>>;
     M m                  = M(expected, expected + 8);
     M m2                 = M(expected, expected + 3);
 
@@ -89,7 +90,7 @@ void test_move_assign_clears() {
   }
   {
     const int expected[] = {1, 2, 3, 4, 5, 6, 7, 8};
-    using M              = std::flat_set<MoveClears, std::less<MoveClears>>;
+    using M              = std::flat_set<MoveClears, std::less<MoveClears>, KeyContainer<MoveClears>>;
     M m                  = M(expected, expected + 8);
     M m2                 = M(expected, expected + 3);
 
@@ -106,7 +107,7 @@ void test_move_assign_clears() {
   }
   {
     // moved-from object maintains invariant if one of underlying container does not clear after move
-    using M = std::flat_set<int, std::less<>, std::vector<int>>;
+    using M = std::flat_set<int, std::less<>, CopyOnlyVector<int>>;
     M m1    = M({1, 2, 3});
     M m2    = M({1, 2});
     m2      = std::move(m1);
@@ -115,7 +116,7 @@ void test_move_assign_clears() {
     LIBCPP_ASSERT(m1.empty());
   }
 #if !defined(TEST_HAS_NO_EXCEPTIONS)
-  {
+  if (!std::is_constant_evaluated()) {
     using M = std::flat_set<int, std::less<>, MoveAssignThrows>;
     M m1    = {1, 2, 3};
     M m2    = {1, 2};
@@ -189,11 +190,12 @@ void test_move_assign_no_except() {
   }
 }
 
-void test() {
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
     using C                           = test_less<int>;
     using A1                          = test_allocator<int>;
-    using M                           = std::flat_set<int, C, std::vector<int, A1>>;
+    using M                           = std::flat_set<int, C, KeyContainer<int, A1>>;
     M mo                              = M({1, 2, 3}, C(5), A1(7));
     M m                               = M({}, C(3), A1(7));
     std::same_as<M&> decltype(auto) r = m = std::move(mo);
@@ -207,7 +209,7 @@ void test() {
   {
     using C                           = test_less<int>;
     using A1                          = other_allocator<int>;
-    using M                           = std::flat_set<int, C, std::deque<int, A1>>;
+    using M                           = std::flat_set<int, C, KeyContainer<int, A1>>;
     M mo                              = M({4, 5}, C(5), A1(7));
     M m                               = M({1, 2, 3, 4}, C(3), A1(7));
     std::same_as<M&> decltype(auto) r = m = std::move(mo);
@@ -220,7 +222,7 @@ void test() {
   }
   {
     using A                           = min_allocator<int>;
-    using M                           = std::flat_set<int, std::greater<int>, std::vector<int, A>>;
+    using M                           = std::flat_set<int, std::greater<int>, KeyContainer<int, A>>;
     M mo                              = M({5, 4, 3}, A());
     M m                               = M({4, 3, 2, 1}, A());
     std::same_as<M&> decltype(auto) r = m = std::move(mo);
@@ -232,10 +234,27 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  test<std::vector>();
+  test_move_assign_clears<std::vector>();
+
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+  {
+    test<std::deque>();
+    test_move_assign_clears<std::deque>();
+  }
+
+  return true;
+}
+
 int main(int, char**) {
   test();
-  test_move_assign_clears();
   test_move_assign_no_except();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/range.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/range.pass.cpp
index bd7b5c12432e9..75b7a7d66ad48 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/range.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/range.pass.cpp
@@ -26,6 +26,7 @@
 #include <string>
 #include <vector>
 
+#include "MinSequenceContainer.h"
 #include "min_allocator.h"
 #include "test_allocator.h"
 #include "test_iterators.h"
@@ -56,35 +57,14 @@ static_assert(
     !std::
         is_constructible_v<Set, std::from_range_t, RangeOf<std::pair<int, int>>, std::less<int>, std::allocator<int>>);
 
-void test() {
-  {
-    // The constructors in this subclause shall not participate in overload
-    // resolution unless uses_allocator_v<container_type, Alloc> is true.
-
-    using C  = test_less<int>;
-    using A1 = test_allocator<int>;
-    using A2 = other_allocator<int>;
-    using V1 = std::vector<int, A1>;
-    using V2 = std::vector<int, A2>;
-    using M1 = std::flat_set<int, C, V1>;
-    using M2 = std::flat_set<int, C, V2>;
-    static_assert(std::is_constructible_v<M1, std::from_range_t, M1, const A1&>);
-    static_assert(std::is_constructible_v<M2, std::from_range_t, M2, const A2&>);
-    static_assert(!std::is_constructible_v<M1, std::from_range_t, M1, const A2&>);
-    static_assert(!std::is_constructible_v<M2, std::from_range_t, M2, const A1&>);
-
-    static_assert(std::is_constructible_v<M1, std::from_range_t, M1, const C&, const A1&>);
-    static_assert(std::is_constructible_v<M2, std::from_range_t, M2, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, std::from_range_t, M1, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, std::from_range_t, M2, const C&, const A1&>);
-  }
-
+template <class KeyContainer>
+constexpr void test() {
   int ar[]       = {1, 1, 1, 2, 2, 3, 2, 3, 3};
   int expected[] = {1, 2, 3};
   {
     // flat_set(from_range_t, R&&)
     // input_range && !common
-    using M    = std::flat_set<int>;
+    using M    = std::flat_set<int, std::less<int>, KeyContainer>;
     using Iter = cpp20_input_iterator<const int*>;
     using Sent = sentinel_wrapper<Iter>;
     using R    = std::ranges::subrange<Iter, Sent>;
@@ -99,17 +79,17 @@ void test() {
   {
     // flat_set(from_range_t, R&&)
     // greater
-    using M    = std::flat_set<int, std::greater<int>, std::deque<int, min_allocator<int>>>;
+    using M    = std::flat_set<int, std::greater<int>, KeyContainer>;
     using Iter = cpp20_input_iterator<const int*>;
     using Sent = sentinel_wrapper<Iter>;
     using R    = std::ranges::subrange<Iter, Sent>;
     auto m     = M(std::from_range, R(Iter(ar), Sent(Iter(ar + 9))));
-    assert(std::ranges::equal(m, std::deque<int, min_allocator<int>>{3, 2, 1}));
+    assert(std::ranges::equal(m, KeyContainer{3, 2, 1}));
   }
   {
     // flat_set(from_range_t, R&&)
     // contiguous range
-    using M = std::flat_set<int>;
+    using M = std::flat_set<int, std::less<int>, KeyContainer>;
     using R = std::ranges::subrange<const int*>;
     auto m  = M(std::from_range, R(ar, ar + 9));
     assert(std::ranges::equal(m, expected));
@@ -117,7 +97,7 @@ void test() {
   {
     // flat_set(from_range_t, R&&, const key_compare&)
     using C = test_less<int>;
-    using M = std::flat_set<int, C, std::vector<int>>;
+    using M = std::flat_set<int, C, KeyContainer>;
     using R = std::ranges::subrange<const int*>;
     auto m  = M(std::from_range, R(ar, ar + 9), C(3));
     assert(std::ranges::equal(m, expected));
@@ -128,10 +108,16 @@ void test() {
     assert(m2 == m);
     assert(m2.key_comp() == C(3));
   }
+}
+
+template <template <class...> class KeyContainer>
+constexpr void test_alloc() {
+  int ar[]       = {1, 1, 1, 2, 2, 3, 2, 3, 3};
+  int expected[] = {1, 2, 3};
   {
     // flat_set(from_range_t, R&&, const Allocator&)
     using A1 = test_allocator<int>;
-    using M  = std::flat_set<int, std::less<int>, std::vector<int, A1>>;
+    using M  = std::flat_set<int, std::less<int>, KeyContainer<int, A1>>;
     using R  = std::ranges::subrange<const int*>;
     auto m   = M(std::from_range, R(ar, ar + 9), A1(5));
     assert(std::ranges::equal(m, expected));
@@ -141,7 +127,7 @@ void test() {
     // flat_set(from_range_t, R&&, const Allocator&)
     // explicit(false)
     using A1 = test_allocator<int>;
-    using M  = std::flat_set<int, std::less<int>, std::deque<int, A1>>;
+    using M  = std::flat_set<int, std::less<int>, KeyContainer<int, A1>>;
     using R  = std::ranges::subrange<const int*>;
     M m      = {std::from_range, R(ar, ar + 9), A1(5)}; // implicit ctor
     assert(std::ranges::equal(m, expected));
@@ -151,7 +137,7 @@ void test() {
     // flat_set(from_range_t, R&&, const key_compare&, const Allocator&)
     using C  = test_less<int>;
     using A1 = test_allocator<int>;
-    using M  = std::flat_set<int, C, std::vector<int, A1>>;
+    using M  = std::flat_set<int, C, KeyContainer<int, A1>>;
     using R  = std::ranges::subrange<const int*>;
     auto m   = M(std::from_range, R(ar, ar + 9), C(3), A1(5));
     assert(std::ranges::equal(m, expected));
@@ -162,7 +148,7 @@ void test() {
     // flat_set(from_range_t, R&&, const key_compare&, const Allocator&)
     // explicit(false)
     using A1 = test_allocator<int>;
-    using M  = std::flat_set<int, std::less<int>, std::deque<int, A1>>;
+    using M  = std::flat_set<int, std::less<int>, KeyContainer<int, A1>>;
     using R  = std::ranges::subrange<const int*>;
     M m      = {std::from_range, R(ar, ar + 9), {}, A1(5)}; // implicit ctor
     assert(std::ranges::equal(m, expected));
@@ -170,8 +156,51 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  {
+    // The constructors in this subclause shall not participate in overload
+    // resolution unless uses_allocator_v<container_type, Alloc> is true.
+
+    using C  = test_less<int>;
+    using A1 = test_allocator<int>;
+    using A2 = other_allocator<int>;
+    using V1 = std::vector<int, A1>;
+    using V2 = std::vector<int, A2>;
+    using M1 = std::flat_set<int, C, V1>;
+    using M2 = std::flat_set<int, C, V2>;
+    static_assert(std::is_constructible_v<M1, std::from_range_t, M1, const A1&>);
+    static_assert(std::is_constructible_v<M2, std::from_range_t, M2, const A2&>);
+    static_assert(!std::is_constructible_v<M1, std::from_range_t, M1, const A2&>);
+    static_assert(!std::is_constructible_v<M2, std::from_range_t, M2, const A1&>);
+
+    static_assert(std::is_constructible_v<M1, std::from_range_t, M1, const C&, const A1&>);
+    static_assert(std::is_constructible_v<M2, std::from_range_t, M2, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, std::from_range_t, M1, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, std::from_range_t, M2, const C&, const A1&>);
+  }
+
+  test<std::vector<int>>();
+  test<std::vector<int, min_allocator<int>>>();
+  test<MinSequenceContainer<int>>();
+
+  test_alloc<std::vector>();
+
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+  {
+    test<std::deque<int>>();
+    test_alloc<std::deque>();
+  }
+
+  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/container.adaptors/flat.set/flat.set.cons/sorted_container.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_container.pass.cpp
index 873ff32b62936..32dd0b6586675 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_container.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_container.pass.cpp
@@ -30,33 +30,13 @@
 #include "test_macros.h"
 #include "../../../test_compare.h"
 
-void test() {
-  {
-    // The constructors in this subclause shall not participate in overload
-    // resolution unless uses_allocator_v<container_type, Alloc> is true.
-
-    using C  = test_less<int>;
-    using A1 = test_allocator<int>;
-    using A2 = other_allocator<int>;
-    using V1 = std::vector<int, A1>;
-    using V2 = std::vector<int, A2>;
-    using M1 = std::flat_set<int, C, V1>;
-    using M2 = std::flat_set<int, C, V2>;
-    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, const V1&, const A1&>);
-    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, const V2&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, const V1&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, const V2&, const A1&>);
-
-    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, const V1&, const C&, const A1&>);
-    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, const V2&, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, const V1&, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, const V2&, const C&, const A1&>);
-  }
+template <template <class...> class KeyContainer>
+constexpr void test() {
   {
     // flat_set(sorted_unique_t, container_type)
-    using M             = std::flat_set<int>;
-    std::vector<int> ks = {1, 2, 4, 10};
-    auto ks2            = ks;
+    using M              = std::flat_set<int, std::less<int>, KeyContainer<int>>;
+    KeyContainer<int> ks = {1, 2, 4, 10};
+    auto ks2             = ks;
 
     auto m = M(std::sorted_unique, ks);
     assert((m == M{1, 2, 4, 10}));
@@ -71,7 +51,7 @@ void test() {
   {
     // flat_set(sorted_unique_t, container_type)
     // non-default container, comparator and allocator type
-    using Ks = std::deque<int, min_allocator<int>>;
+    using Ks = KeyContainer<int, min_allocator<int>>;
     using M  = std::flat_set<int, std::greater<int>, Ks>;
     Ks ks    = {10, 4, 2, 1};
     auto m   = M(std::sorted_unique, ks);
@@ -84,8 +64,8 @@ void test() {
     // flat_set(sorted_unique_t, container_type)
     // allocator copied into the containers
     using A = test_allocator<int>;
-    using M = std::flat_set<int, std::less<int>, std::deque<int, A>>;
-    auto ks = std::deque<int, A>({1, 2, 4, 10}, A(4));
+    using M = std::flat_set<int, std::less<int>, KeyContainer<int, A>>;
+    auto ks = KeyContainer<int, A>({1, 2, 4, 10}, A(4));
     auto m  = M(std::sorted_unique, std::move(ks));
     assert(ks.empty()); // it was moved-from
     assert((m == M{1, 2, 4, 10}));
@@ -93,9 +73,9 @@ void test() {
   }
   {
     // flat_set(sorted_unique_t, container_type ,  key_compare)
-    using C             = test_less<int>;
-    using M             = std::flat_set<int, C>;
-    std::vector<int> ks = {1, 2, 4, 10};
+    using C              = test_less<int>;
+    using M              = std::flat_set<int, C, KeyContainer<int>>;
+    KeyContainer<int> ks = {1, 2, 4, 10};
 
     auto m = M(std::sorted_unique, ks, C(4));
     assert((m == M{1, 2, 4, 10}));
@@ -108,11 +88,11 @@ void test() {
   }
   {
     // flat_set(sorted_unique_t, container_type , key_compare, const Allocator&)
-    using C                = test_less<int>;
-    using A                = test_allocator<int>;
-    using M                = std::flat_set<int, C, std::vector<int, A>>;
-    std::vector<int, A> ks = {1, 2, 4, 10};
-    auto m                 = M(std::sorted_unique, ks, C(4), A(5));
+    using C                 = test_less<int>;
+    using A                 = test_allocator<int>;
+    using M                 = std::flat_set<int, C, KeyContainer<int, A>>;
+    KeyContainer<int, A> ks = {1, 2, 4, 10};
+    auto m                  = M(std::sorted_unique, ks, C(4), A(5));
     assert((m == M{1, 2, 4, 10}));
     assert(m.key_comp() == C(4));
     assert(M(m).extract().get_allocator() == A(5));
@@ -126,8 +106,8 @@ void test() {
   {
     // flat_set(sorted_unique_t, container_type , const Allocator&)
     using A = test_allocator<int>;
-    using M = std::flat_set<int, std::less<int>, std::deque<int, A>>;
-    auto ks = std::deque<int, A>({1, 2, 4, 10}, A(4));
+    using M = std::flat_set<int, std::less<int>, KeyContainer<int, A>>;
+    auto ks = KeyContainer<int, A>({1, 2, 4, 10}, A(4));
     auto m  = M(std::sorted_unique, ks, A(6)); // replaces the allocators
     assert(!ks.empty());                       // it was an lvalue above
     assert((m == M{1, 2, 4, 10}));
@@ -140,8 +120,43 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  {
+    // The constructors in this subclause shall not participate in overload
+    // resolution unless uses_allocator_v<container_type, Alloc> is true.
+
+    using C  = test_less<int>;
+    using A1 = test_allocator<int>;
+    using A2 = other_allocator<int>;
+    using V1 = std::vector<int, A1>;
+    using V2 = std::vector<int, A2>;
+    using M1 = std::flat_set<int, C, V1>;
+    using M2 = std::flat_set<int, C, V2>;
+    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, const V1&, const A1&>);
+    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, const V2&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, const V1&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, const V2&, const A1&>);
+
+    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, const V1&, const C&, const A1&>);
+    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, const V2&, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, const V1&, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, const V2&, const C&, const A1&>);
+  }
+
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/sorted_initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_initializer_list.pass.cpp
index a8dac35aefee8..993a01208fb76 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_initializer_list.pass.cpp
@@ -31,60 +31,16 @@
 #include "../../../test_compare.h"
 
 template <class T>
-std::initializer_list<T> il = {1, 2, 4, 5};
+constexpr std::initializer_list<T> il = {1, 2, 4, 5};
 
-void test() {
+template <template <class...> class KeyContainer>
+constexpr void test() {
   const auto il1 = il<int>;
   const auto il2 = il<short>;
 
-  {
-    // The constructors in this subclause shall not participate in overload
-    // resolution unless uses_allocator_v<container_type, Alloc> is true.
-
-    using C  = test_less<int>;
-    using A1 = test_allocator<int>;
-    using A2 = other_allocator<int>;
-    using V1 = std::vector<int, A1>;
-    using V2 = std::vector<int, A2>;
-    using M1 = std::flat_set<int, C, V1>;
-    using M2 = std::flat_set<int, C, V2>;
-    using IL = std::initializer_list<int>;
-
-    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, IL, const A1&>);
-    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, IL, const A2&>);
-    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, IL, const A2&>);
-    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, IL, const A1&>);
-
-    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, IL, const C&, const A1&>);
-    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, IL, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, IL, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, IL, const C&, const A1&>);
-  }
-  {
-    // initializer_list<value_type> needs to match exactly
-    using M = std::flat_set<int>;
-    using C = typename M::key_compare;
-    static_assert(std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<int>>);
-    static_assert(std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<int>, C>);
-    static_assert(std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<int>, C, std::allocator<int>>);
-    static_assert(std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<int>, std::allocator<int>>);
-    static_assert(!std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>>);
-    static_assert(!std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, C>);
-    static_assert(
-        !std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, C, std::allocator<int>>);
-    static_assert(
-        !std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, std::allocator<int>>);
-    static_assert(!std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>>);
-    static_assert(!std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, C>);
-    static_assert(
-        !std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, C, std::allocator<int>>);
-    static_assert(
-        !std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, std::allocator<int>>);
-  }
-
   {
     // flat_set(sorted_unique_t, initializer_list<value_type>);
-    using M       = std::flat_set<int>;
+    using M       = std::flat_set<int, std::less<int>, KeyContainer<int>>;
     auto m        = M(std::sorted_unique, il1);
     auto expected = M{1, 2, 4, 5};
     assert(m == expected);
@@ -93,9 +49,9 @@ void test() {
     M m2 = {std::sorted_unique, il1};
     assert(m2 == m);
   }
-  {
+  if (!std::is_constant_evaluated()) {
     // flat_set(sorted_unique_t, initializer_list<value_type>, const key_compare&);
-    using M = std::flat_set<int, std::function<bool(int, int)>>;
+    using M = std::flat_set<int, std::function<bool(int, int)>, KeyContainer<int>>;
     auto m  = M(std::sorted_unique, il1, std::less<int>());
     assert(m == M({1, 2, 4, 5}, std::less<>()));
     assert(m.key_comp()(1, 2) == true);
@@ -107,7 +63,7 @@ void test() {
   {
     // flat_set(sorted_unique_t, initializer_list<value_type>, const key_compare&);
     // greater
-    using M = std::flat_set<int, std::greater<int>, std::deque<int, min_allocator<int>>>;
+    using M = std::flat_set<int, std::greater<int>, KeyContainer<int, min_allocator<int>>>;
     std::initializer_list<int> il4{5, 4, 2, 1};
     auto m = M(std::sorted_unique, il4, std::greater<int>());
     assert((m == M{5, 4, 2, 1}));
@@ -115,7 +71,7 @@ void test() {
   {
     // flat_set(sorted_unique_t, initializer_list<value_type>,  const Allocator&)
     using A1      = test_allocator<short>;
-    using M       = std::flat_set<short, std::less<int>, std::deque<short, A1>>;
+    using M       = std::flat_set<short, std::less<int>, KeyContainer<short, A1>>;
     auto m        = M(std::sorted_unique, il2, A1(5));
     auto expected = M{1, 2, 4, 5};
     assert(m == expected);
@@ -130,7 +86,7 @@ void test() {
     // flat_set(sorted_unique_t, initializer_list<value_type>, const key_compare&, const Allocator&);
     using C  = test_less<int>;
     using A1 = test_allocator<short>;
-    using M  = std::flat_set<short, C, std::vector<short, A1>>;
+    using M  = std::flat_set<short, C, KeyContainer<short, A1>>;
     auto m   = M(std::sorted_unique, il2, C(3), A1(5));
     assert((m == M{1, 2, 4, 5}));
     assert(m.key_comp() == C(3));
@@ -140,15 +96,73 @@ void test() {
     // flat_set(sorted_unique_t, initializer_list<value_type>, const key_compare&, const Allocator&);
     // explicit(false)
     using A1 = test_allocator<short>;
-    using M  = std::flat_set<short, std::less<int>, std::deque<short, A1>>;
+    using M  = std::flat_set<short, std::less<int>, KeyContainer<short, A1>>;
     M m      = {std::sorted_unique, il2, {}, A1(5)}; // implicit ctor
     assert((m == M{1, 2, 4, 5}));
     assert(std::move(m).extract().get_allocator() == A1(5));
   }
 }
 
+constexpr bool test() {
+  {
+    // The constructors in this subclause shall not participate in overload
+    // resolution unless uses_allocator_v<container_type, Alloc> is true.
+
+    using C  = test_less<int>;
+    using A1 = test_allocator<int>;
+    using A2 = other_allocator<int>;
+    using V1 = std::vector<int, A1>;
+    using V2 = std::vector<int, A2>;
+    using M1 = std::flat_set<int, C, V1>;
+    using M2 = std::flat_set<int, C, V2>;
+    using IL = std::initializer_list<int>;
+
+    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, IL, const A1&>);
+    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, IL, const A2&>);
+    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, IL, const A2&>);
+    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, IL, const A1&>);
+
+    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, IL, const C&, const A1&>);
+    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, IL, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, IL, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, IL, const C&, const A1&>);
+  }
+  {
+    // initializer_list<value_type> needs to match exactly
+    using M = std::flat_set<int>;
+    using C = typename M::key_compare;
+    static_assert(std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<int>>);
+    static_assert(std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<int>, C>);
+    static_assert(std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<int>, C, std::allocator<int>>);
+    static_assert(std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<int>, std::allocator<int>>);
+    static_assert(!std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>>);
+    static_assert(!std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, C>);
+    static_assert(
+        !std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, C, std::allocator<int>>);
+    static_assert(
+        !std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, std::allocator<int>>);
+    static_assert(!std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>>);
+    static_assert(!std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, C>);
+    static_assert(
+        !std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, C, std::allocator<int>>);
+    static_assert(
+        !std::is_constructible_v<M, std::sorted_unique_t, std::initializer_list<const int>, std::allocator<int>>);
+  }
+
+  test<std::vector>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test<std::deque>();
+
+  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/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp
index b184ee9c3f5ab..2ebd3247abf42 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp
@@ -22,40 +22,19 @@
 #include <functional>
 #include <vector>
 
+#include "MinSequenceContainer.h"
 #include "min_allocator.h"
 #include "test_allocator.h"
 #include "test_iterators.h"
 #include "test_macros.h"
 #include "../../../test_compare.h"
 
-void test() {
-  {
-    // The constructors in this subclause shall not participate in overload
-    // resolution unless uses_allocator_v<container_type, Alloc> is true.
-
-    using C     = test_less<int>;
-    using A1    = test_allocator<int>;
-    using A2    = other_allocator<int>;
-    using V1    = std::vector<int, A1>;
-    using V2    = std::vector<int, A2>;
-    using M1    = std::flat_set<int, C, V1>;
-    using M2    = std::flat_set<int, C, V2>;
-    using Iter1 = typename M1::iterator;
-    using Iter2 = typename M2::iterator;
-    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, Iter1, Iter1, const A1&>);
-    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, Iter2, Iter2, const A2&>);
-    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, Iter1, Iter1, const A2&>);
-    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, Iter2, Iter2, const A1&>);
-
-    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, Iter1, Iter1, const C&, const A1&>);
-    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, Iter2, Iter2, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, Iter1, Iter1, const C&, const A2&>);
-    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, Iter2, Iter2, const C&, const A1&>);
-  }
+template <class KeyContainer>
+constexpr void test() {
   {
     // flat_set(sorted_unique_t, InputIterator, InputIterator);
     // cpp17_input_iterator
-    using M  = std::flat_set<int>;
+    using M  = std::flat_set<int, std::less<int>, KeyContainer>;
     int ar[] = {1, 2, 4, 5};
     auto m   = M(std::sorted_unique, cpp17_input_iterator<const int*>(ar), cpp17_input_iterator<const int*>(ar + 4));
     auto expected = M{1, 2, 4, 5};
@@ -69,16 +48,16 @@ void test() {
     // flat_set(sorted_unique_t, InputIterator, InputIterator);
     // contiguous iterator
     using C       = test_less<int>;
-    using M       = std::flat_set<int, C, std::vector<int, min_allocator<int>>>;
+    using M       = std::flat_set<int, C, KeyContainer>;
     int ar[]      = {1, 2, 4, 5};
     auto m        = M(std::sorted_unique, ar, ar + 4);
     auto expected = M{1, 2, 4, 5};
     assert(m == expected);
   }
-  {
+  if (!std::is_constant_evaluated()) {
     // flat_set(sorted_unique_t, InputIterator, InputIterator, const key_compare&);
     // cpp_17_input_iterator
-    using M  = std::flat_set<int, std::function<bool(int, int)>>;
+    using M  = std::flat_set<int, std::function<bool(int, int)>, KeyContainer>;
     int ar[] = {1, 2, 4, 5};
     auto m   = M(std::sorted_unique,
                cpp17_input_iterator<const int*>(ar),
@@ -97,7 +76,7 @@ void test() {
   {
     // flat_set(sorted_unique_t, InputIterator, InputIterator, const key_compare&);
     // greater
-    using M  = std::flat_set<int, std::greater<int>, std::deque<int, min_allocator<int>>>;
+    using M  = std::flat_set<int, std::greater<int>, KeyContainer>;
     int ar[] = {5, 4, 2, 1};
     auto m   = M(std::sorted_unique,
                cpp17_input_iterator<const int*>(ar),
@@ -109,16 +88,20 @@ void test() {
     // flat_set(sorted_unique_t, InputIterator, InputIterator, const key_compare&);
     // contiguous iterator
     using C   = test_less<int>;
-    using M   = std::flat_set<int, C, std::vector<int, min_allocator<int>>>;
+    using M   = std::flat_set<int, C, KeyContainer>;
     int ar[1] = {42};
     auto m    = M(std::sorted_unique, ar, ar, C(5));
     assert(m.empty());
     assert(m.key_comp() == C(5));
   }
+}
+
+template <template <class...> class KeyContainer>
+constexpr void test_alloc() {
   {
     // flat_set(sorted_unique_t, InputIterator , InputIterator, const Allocator&)
     using A1      = test_allocator<int>;
-    using M       = std::flat_set<int, std::less<int>, std::vector<int, A1>>;
+    using M       = std::flat_set<int, std::less<int>, KeyContainer<int, A1>>;
     int ar[]      = {1, 2, 4, 5};
     auto m        = M(std::sorted_unique, ar, ar + 4, A1(5));
     auto expected = M{1, 2, 4, 5};
@@ -134,7 +117,7 @@ void test() {
     // flat_set(sorted_unique_t, InputIterator, InputIterator, const key_compare&, const Allocator&);
     using C  = test_less<int>;
     using A1 = test_allocator<int>;
-    using M  = std::flat_set<int, C, std::deque<int, A1>>;
+    using M  = std::flat_set<int, C, KeyContainer<int, A1>>;
     int ar[] = {1, 2, 4, 5};
     auto m   = M(std::sorted_unique, ar, ar + 4, C(3), A1(5));
     assert((m == M{1, 2, 4, 5}));
@@ -145,7 +128,7 @@ void test() {
     // flat_set(sorted_unique_t, InputIterator, InputIterator, const key_compare&, const Allocator&);
     // explicit(false)
     using A1 = test_allocator<short>;
-    using M  = std::flat_set<short, std::less<int>, std::deque<short, A1>>;
+    using M  = std::flat_set<short, std::less<int>, KeyContainer<short, A1>>;
     int ar[] = {1, 2, 4, 5};
     M m      = {std::sorted_unique, ar, ar + 4, {}, A1(5)}; // implicit ctor
     assert((m == M{1, 2, 4, 5}));
@@ -153,8 +136,52 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  {
+    // The constructors in this subclause shall not participate in overload
+    // resolution unless uses_allocator_v<container_type, Alloc> is true.
+
+    using C     = test_less<int>;
+    using A1    = test_allocator<int>;
+    using A2    = other_allocator<int>;
+    using V1    = std::vector<int, A1>;
+    using V2    = std::vector<int, A2>;
+    using M1    = std::flat_set<int, C, V1>;
+    using M2    = std::flat_set<int, C, V2>;
+    using Iter1 = typename M1::iterator;
+    using Iter2 = typename M2::iterator;
+    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, Iter1, Iter1, const A1&>);
+    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, Iter2, Iter2, const A2&>);
+    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, Iter1, Iter1, const A2&>);
+    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, Iter2, Iter2, const A1&>);
+
+    static_assert(std::is_constructible_v<M1, std::sorted_unique_t, Iter1, Iter1, const C&, const A1&>);
+    static_assert(std::is_constructible_v<M2, std::sorted_unique_t, Iter2, Iter2, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M1, std::sorted_unique_t, Iter1, Iter1, const C&, const A2&>);
+    static_assert(!std::is_constructible_v<M2, std::sorted_unique_t, Iter2, Iter2, const C&, const A1&>);
+  }
+
+  test<std::vector<int>>();
+  test<std::vector<int, min_allocator<int>>>();
+  test<MinSequenceContainer<int>>();
+  test_alloc<std::vector>();
+
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+  {
+    test<std::deque<int>>();
+    test_alloc<std::deque>();
+  }
+
+  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/container.adaptors/flat.set/flat.set.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.erasure/erase_if.pass.cpp
index d7d7a98f49d77..fafbf46f13acb 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.erasure/erase_if.pass.cpp
@@ -32,7 +32,7 @@ static_assert(HasStdErase<std::vector<int>>);
 static_assert(!HasStdErase<std::flat_set<int>>);
 
 template <class M>
-M make(std::initializer_list<int> vals) {
+constexpr M make(std::initializer_list<int> vals) {
   M ret;
   for (int v : vals)
     ret.emplace(v);
@@ -40,8 +40,8 @@ M make(std::initializer_list<int> vals) {
 }
 
 template <class M, class Pred>
-void test0(
-    std::initializer_list<int> vals, Pred p, std::initializer_list<int> expected, std::size_t expected_erased_count) {
+constexpr void
+test0(std::initializer_list<int> vals, Pred p, std::initializer_list<int> expected, std::size_t expected_erased_count) {
   M s = make<M>(vals);
   ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));
@@ -50,11 +50,11 @@ void test0(
 
 struct NotBool {
   bool b;
-  explicit operator bool() const { return b; }
+  constexpr explicit operator bool() const { return b; }
 };
 
 template <class S>
-void test_one() {
+constexpr void test_one() {
   // Test all the plausible signatures for this predicate.
   auto is1        = [](typename S::const_reference v) { return v == 1; };
   auto is2        = [](typename S::value_type v) { return v == 2; };
@@ -84,18 +84,28 @@ void test_one() {
   test0<S>({1, 2, 3}, nonBoolIs1, {2, 3}, 1);
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::flat_set<int>>();
   test_one<std::flat_set<int, std::less<int>, std::vector<int, min_allocator<int>>>>();
   test_one<std::flat_set<int, std::greater<int>, std::vector<int, test_allocator<int>>>>();
-  test_one<std::flat_set<int, std::less<int>, std::deque<int, min_allocator<int>>>>();
-  test_one<std::flat_set<int, std::greater<int>, std::deque<int, test_allocator<int>>>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+  {
+    test_one<std::flat_set<int, std::less<int>, std::deque<int, min_allocator<int>>>>();
+    test_one<std::flat_set<int, std::greater<int>, std::deque<int, test_allocator<int>>>>();
+  }
   test_one<std::flat_set<long>>();
   test_one<std::flat_set<double>>();
+
+  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/container.adaptors/flat.set/flat.set.iterators/iterator.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator.pass.cpp
index 846bcff63d773..4b4abba094459 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator.pass.cpp
@@ -30,7 +30,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
 
@@ -67,9 +67,12 @@ void test_one() {
   assert(i == m.begin());
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
 
@@ -88,10 +91,15 @@ void test() {
     assert(!(ii1 != cii));
     assert(!(cii != ii1));
   }
+
+  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/container.adaptors/flat.set/flat.set.iterators/iterator_comparison.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator_comparison.pass.cpp
index ad1bc8facc92e..c639c23d7ffa8 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator_comparison.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator_comparison.pass.cpp
@@ -24,7 +24,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using I   = M::iterator;
@@ -141,15 +141,23 @@ void test_one() {
   assert(cri2 <=> cri1 == std::strong_ordering::greater);
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp
index 4c2482cd0f3de..81ca5cd003204 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp
@@ -25,19 +25,22 @@
 
 #include <iterator>
 
+#include "MinSequenceContainer.h"
+#include "min_allocator.h"
 #include "test_macros.h"
 
-void test() {
+template <class KeyContainer>
+constexpr void test_one() {
   {
-    using M     = std::flat_set<int, std::less<int>, std::deque<int>>;
+    using M     = std::flat_set<int, std::less<int>, KeyContainer>;
     M m         = {1, 2, 3, 4};
     const M& cm = m;
-    ASSERT_SAME_TYPE(decltype(m.rbegin()), M::reverse_iterator);
-    ASSERT_SAME_TYPE(decltype(m.crbegin()), M::const_reverse_iterator);
-    ASSERT_SAME_TYPE(decltype(cm.rbegin()), M::const_reverse_iterator);
-    ASSERT_SAME_TYPE(decltype(m.rend()), M::reverse_iterator);
-    ASSERT_SAME_TYPE(decltype(m.crend()), M::const_reverse_iterator);
-    ASSERT_SAME_TYPE(decltype(cm.rend()), M::const_reverse_iterator);
+    ASSERT_SAME_TYPE(decltype(m.rbegin()), typename M::reverse_iterator);
+    ASSERT_SAME_TYPE(decltype(m.crbegin()), typename M::const_reverse_iterator);
+    ASSERT_SAME_TYPE(decltype(cm.rbegin()), typename M::const_reverse_iterator);
+    ASSERT_SAME_TYPE(decltype(m.rend()), typename M::reverse_iterator);
+    ASSERT_SAME_TYPE(decltype(m.crend()), typename M::const_reverse_iterator);
+    ASSERT_SAME_TYPE(decltype(cm.rend()), typename M::const_reverse_iterator);
     static_assert(noexcept(m.rbegin()));
     static_assert(noexcept(cm.rbegin()));
     static_assert(noexcept(m.crbegin()));
@@ -49,12 +52,12 @@ void test() {
     assert(std::distance(cm.rbegin(), cm.rend()) == 4);
     assert(std::distance(m.crbegin(), m.crend()) == 4);
     assert(std::distance(cm.crbegin(), cm.crend()) == 4);
-    M::reverse_iterator i; // default-construct
+    typename M::reverse_iterator i; // default-construct
     ASSERT_SAME_TYPE(decltype(*i), const int&);
-    i                           = m.rbegin(); // move-assignment
-    M::const_reverse_iterator k = i;          // converting constructor
-    assert(i == k);                           // comparison
-    for (int j = 4; j >= 1; --j, ++i) {       // pre-increment
+    i                                    = m.rbegin(); // move-assignment
+    typename M::const_reverse_iterator k = i;          // converting constructor
+    assert(i == k);                                    // comparison
+    for (int j = 4; j >= 1; --j, ++i) {                // pre-increment
       assert(*i == j);
     }
     assert(i == m.rend());
@@ -65,11 +68,11 @@ void test() {
     assert(i == m.rbegin());
   }
   {
+    using M = std::flat_set<int, std::less<int>, KeyContainer>;
     // N3644 testing
-    using C = std::flat_set<int>;
-    C::reverse_iterator ii1{}, ii2{};
-    C::reverse_iterator ii4 = ii1;
-    C::const_reverse_iterator cii{};
+    typename M::reverse_iterator ii1{}, ii2{};
+    typename M::reverse_iterator ii4 = ii1;
+    typename M::const_reverse_iterator cii{};
     assert(ii1 == ii2);
     assert(ii1 == ii4);
     assert(!(ii1 != ii2));
@@ -81,8 +84,23 @@ void test() {
   }
 }
 
+constexpr bool test() {
+  test_one<std::vector<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
+  test_one<MinSequenceContainer<int>>();
+  test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.modifiers/clear.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/clear.pass.cpp
index 5ecdc429b3c58..e3e5068fa06f8 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/clear.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/clear.pass.cpp
@@ -38,7 +38,7 @@ static_assert(NoExceptClear<std::flat_set<int, std::less<int>, ThrowOnMoveContai
 #endif
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   {
@@ -58,17 +58,24 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cpp
index 79800e894afbf..1e615f94fee16 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cpp
@@ -28,7 +28,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using R   = std::pair<typename M::iterator, bool>;
@@ -98,7 +98,7 @@ void test_one() {
 }
 
 template <class KeyContainer>
-void test_emplaceable() {
+constexpr void test_emplaceable() {
   using M = std::flat_set<Emplaceable, std::less<Emplaceable>, KeyContainer>;
   using R = std::pair<typename M::iterator, bool>;
 
@@ -121,16 +121,24 @@ void test_emplaceable() {
   assert(*m.begin() == Emplaceable(1, 3.5));
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
 
   test_emplaceable<std::vector<Emplaceable>>();
-  test_emplaceable<std::deque<Emplaceable>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_emplaceable<std::deque<Emplaceable>>();
   test_emplaceable<MinSequenceContainer<Emplaceable>>();
   test_emplaceable<std::vector<Emplaceable, min_allocator<Emplaceable>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -141,6 +149,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cpp
index b3bd8adf0c35d..27cd740eca64d 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cpp
@@ -27,7 +27,7 @@
 #include "../helpers.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using R   = M::iterator;
@@ -114,7 +114,7 @@ void test_one() {
 }
 
 template <class KeyContainer>
-void test_emplaceable() {
+constexpr void test_emplaceable() {
   using M = std::flat_set<Emplaceable, std::less<Emplaceable>, KeyContainer>;
   using R = M::iterator;
 
@@ -134,16 +134,24 @@ void test_emplaceable() {
   assert(*m.begin() == Emplaceable(1, 3.5));
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
 
   test_emplaceable<std::vector<Emplaceable>>();
-  test_emplaceable<std::vector<Emplaceable>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_emplaceable<std::deque<Emplaceable>>();
   test_emplaceable<MinSequenceContainer<Emplaceable>>();
   test_emplaceable<std::vector<Emplaceable, min_allocator<Emplaceable>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -154,6 +162,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter.pass.cpp
index 27c6fadb5341e..1ec4dc89f6516 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter.pass.cpp
@@ -27,7 +27,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using I   = M::iterator;
@@ -94,11 +94,16 @@ void test_one() {
   assert(i8 == m.end());
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -109,6 +114,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter_iter.pass.cpp
index f44a8864bdbc8..ce5c214706c6b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter_iter.pass.cpp
@@ -26,7 +26,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using I   = M::iterator;
@@ -78,11 +78,16 @@ void test_one() {
   assert(i5 == m.end());
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -93,6 +98,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key.pass.cpp
index c50b219895b17..c2e857e566ff7 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key.pass.cpp
@@ -26,7 +26,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer, class Compare = std::less<>>
-void test_one() {
+constexpr void test_one() {
   using M = std::flat_set<int, Compare, KeyContainer>;
 
   auto make = [](std::initializer_list<int> il) {
@@ -74,12 +74,17 @@ void test_one() {
   assert(m.empty());
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
   test_one<std::vector<int>, std::greater<>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -95,6 +100,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key_transparent.pass.cpp
index f4b373364cab2..98c3298306d60 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key_transparent.pass.cpp
@@ -38,10 +38,10 @@ static_assert(!CanErase<const NonTransparentSet>);
 
 template <class Key, class It>
 struct HeterogeneousKey {
-  explicit HeterogeneousKey(Key key, It it) : key_(key), it_(it) {}
-  operator It() && { return it_; }
-  auto operator<=>(Key key) const { return key_ <=> key; }
-  friend bool operator<(const HeterogeneousKey&, const HeterogeneousKey&) {
+  constexpr explicit HeterogeneousKey(Key key, It it) : key_(key), it_(it) {}
+  constexpr operator It() && { return it_; }
+  constexpr auto operator<=>(Key key) const { return key_ <=> key; }
+  constexpr friend bool operator<(const HeterogeneousKey&, const HeterogeneousKey&) {
     assert(false);
     return false;
   }
@@ -50,7 +50,7 @@ struct HeterogeneousKey {
 };
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
 
@@ -70,7 +70,7 @@ void test_one() {
 }
 
 template <class KeyContainer>
-void test_transparent_comparator() {
+constexpr void test_transparent_comparator() {
   using M = std::flat_set<std::string, TransparentComparator, KeyContainer>;
   {
     M m = {"alpha", "beta", "epsilon", "eta", "gamma"};
@@ -95,14 +95,20 @@ void test_transparent_comparator() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
 
   test_transparent_comparator<std::vector<std::string>>();
-  test_transparent_comparator<std::deque<std::string>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_transparent_comparator<std::deque<std::string>>();
   test_transparent_comparator<MinSequenceContainer<std::string>>();
   test_transparent_comparator<std::vector<std::string, min_allocator<std::string>>>();
 
@@ -145,6 +151,8 @@ void test() {
     auto n = m.erase("beta");
     assert(n == 1);
   }
+
+  return true;
 }
 
 void test_exception() {
@@ -159,6 +167,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/extract.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/extract.pass.cpp
index 12e63e0d23e1d..23a3e93c7958b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/extract.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/extract.pass.cpp
@@ -33,7 +33,7 @@ static_assert(!CanExtract<std::flat_set<int> const&>);
 static_assert(!CanExtract<std::flat_set<int> const&&>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using M = std::flat_set<int, std::less<int>, KeyContainer>;
   {
     M m = M({1, 2, 3});
@@ -55,9 +55,12 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
 
@@ -70,6 +73,8 @@ void test() {
     check_invariant(m);
     LIBCPP_ASSERT(m.empty());
   }
+
+  return true;
 }
 
 void test_exception() {
@@ -97,6 +102,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cpp
index e0cb80f74462c..227969700f051 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cpp
@@ -23,7 +23,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using R   = std::pair<typename M::iterator, bool>;
@@ -59,11 +59,16 @@ void test_one() {
   assert(*r.first == 3);
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -78,6 +83,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_initializer_list.pass.cpp
index 992c96ecba1a2..9a717a1c39f9f 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_initializer_list.pass.cpp
@@ -23,7 +23,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using V   = typename M::value_type;
@@ -67,11 +67,16 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -87,6 +92,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cpp
index 76b4d5f0eb7cc..914640fd8e0fd 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cpp
@@ -23,7 +23,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using R   = typename M::iterator;
@@ -55,11 +55,16 @@ void test_one() {
   assert(*r == 3);
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -75,6 +80,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_iter.pass.cpp
index 18bdb798de01f..c7b74d44d6009 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_iter.pass.cpp
@@ -37,7 +37,7 @@ static_assert(!CanInsert<Set, int, int>);
 static_assert(!CanInsert<Set, cpp20_input_iterator<int*>, cpp20_input_iterator<int*>>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using M = std::flat_set<int, std::less<int>, KeyContainer>;
 
   int ar1[] = {
@@ -75,9 +75,12 @@ void test_one() {
   assert(m == expected2);
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
   {
@@ -86,6 +89,8 @@ void test() {
     m.insert(v.begin(), v.end());
     assert(std::ranges::equal(m, std::vector<int>{1, 2, 3, 4}));
   }
+
+  return true;
 }
 
 void test_exception() {
@@ -96,6 +101,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cpp
index d29de98e4d3dd..191f06f64239b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cpp
@@ -22,7 +22,7 @@
 #include "test_macros.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using V   = Key;
@@ -49,15 +49,22 @@ void test_one() {
   assert(*r == V(3));
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
   test_one<std::vector<MoveOnly>>();
-  test_one<std::deque<int>>();
-  test_one<std::deque<MoveOnly>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+  {
+    test_one<std::deque<int>>();
+    test_one<std::deque<MoveOnly>>();
+  }
   test_one<MinSequenceContainer<int>>();
   test_one<MinSequenceContainer<MoveOnly>>();
   test_one<std::vector<int, min_allocator<int>>>();
   test_one<std::vector<MoveOnly, min_allocator<MoveOnly>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -73,6 +80,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_range.pass.cpp
index 966a696c096b9..90e7ce9f53c99 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_range.pass.cpp
@@ -39,7 +39,7 @@ static_assert(!CanInsertRange<Set, std::ranges::subrange<std::pair<int, int>*>>)
 static_assert(!CanInsertRange<Set, std::ranges::subrange<std::pair<short, short>*>>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
 
   {
@@ -65,7 +65,7 @@ void test_one() {
   {
     // The "uniquing" part uses the comparator, not operator==.
     struct ModTen {
-      bool operator()(int a, int b) const { return (a % 10) < (b % 10); }
+      constexpr bool operator()(int a, int b) const { return (a % 10) < (b % 10); }
     };
     using M  = std::flat_set<Key, ModTen, KeyContainer>;
     M m      = {21, 43, 15, 37};
@@ -83,9 +83,12 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
   {
@@ -96,6 +99,8 @@ void test() {
     MoveOnly expected[] = {1, 3, 4, 5};
     assert(std::ranges::equal(m, expected));
   }
+
+  return true;
 }
 
 void test_exception() {
@@ -106,6 +111,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cpp
index a179632d64211..f0180f6899361 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cpp
@@ -25,7 +25,7 @@
 #include "../helpers.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, TransparentComparator, KeyContainer>;
   using R   = std::pair<typename M::iterator, bool>;
@@ -57,15 +57,22 @@ void test_one() {
   assert(*r.first == V(3));
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
   test_one<std::vector<MoveOnly>>();
-  test_one<std::deque<int>>();
-  test_one<std::deque<MoveOnly>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+  {
+    test_one<std::deque<int>>();
+    test_one<std::deque<MoveOnly>>();
+  }
   test_one<MinSequenceContainer<int>>();
   test_one<MinSequenceContainer<MoveOnly>>();
   test_one<std::vector<int, min_allocator<int>>>();
   test_one<std::vector<MoveOnly, min_allocator<MoveOnly>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -81,6 +88,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_initializer_list.pass.cpp
index fb0a8b049e72a..479340cd4e5e1 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_initializer_list.pass.cpp
@@ -23,7 +23,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   using V   = Key;
@@ -47,11 +47,16 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -67,6 +72,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_iter_iter.pass.cpp
index 6258c4dbfdcbb..5abeacebff6e7 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_iter_iter.pass.cpp
@@ -36,7 +36,7 @@ static_assert(!CanInsert<Set, std::sorted_unique_t, int, int>);
 static_assert(!CanInsert<Set, std::sorted_unique_t, cpp20_input_iterator<int*>, cpp20_input_iterator<int*>>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
 
@@ -60,11 +60,16 @@ void test_one() {
   assert(m == expected2);
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -77,6 +82,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp
index 4b5779a10ee7a..ae6de12528e6e 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp
@@ -46,7 +46,7 @@ static_assert(!CanInsert<NonTransparentSet, NonConvertibleTransparent<int>>);
 static_assert(!CanInsert<NonTransparentSet, NonTransparentSetIter, NonConvertibleTransparent<int>>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, TransparentComparator, KeyContainer>;
 
@@ -105,9 +105,12 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
 
@@ -131,6 +134,8 @@ void test() {
     assert(!inserted);
     assert(iter == m.begin() + 1);
   }
+
+  return true;
 }
 
 void test_exception() {
@@ -153,6 +158,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/replace.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/replace.pass.cpp
index 591def4c0f938..dd783692e3d60 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/replace.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/replace.pass.cpp
@@ -31,7 +31,7 @@ static_assert(CanReplace<Set, std::vector<int>>);
 static_assert(!CanReplace<Set, const std::vector<int>&>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   {
@@ -51,11 +51,16 @@ void test_one() {
   assert(std::ranges::equal(m, expected_keys));
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
+
+  return true;
 }
 
 void test_exception() {
@@ -81,6 +86,9 @@ void test_exception() {
 int main(int, char**) {
   test();
   test_exception();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_free.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_free.pass.cpp
index 686fe93a593f5..f86fa0cffed6a 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_free.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_free.pass.cpp
@@ -38,7 +38,7 @@ static_assert(NoExceptAdlSwap<std::flat_set<int, std::less<int>, ThrowOnMoveCont
 #endif
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
 
@@ -84,15 +84,22 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
-  test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.modifiers/swap_member.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_member.pass.cpp
index 1eac55d768ce0..7ce42ed4d935a 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_member.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_member.pass.cpp
@@ -37,7 +37,7 @@ static_assert(NoExceptMemberSwap<std::flat_set<int, std::less<int>, ThrowOnMoveC
 #endif
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<Key>, KeyContainer>;
   {
@@ -82,15 +82,23 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.observers/comp.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.observers/comp.pass.cpp
index ba2c428c9e30e..232c7c2bc9e93 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.observers/comp.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.observers/comp.pass.cpp
@@ -21,7 +21,7 @@
 
 #include "test_macros.h"
 
-void test() {
+constexpr bool test() {
   {
     using M    = std::flat_set<int>;
     using Comp = std::less<int>; // the default
@@ -36,7 +36,7 @@ void test() {
     assert(vc(1, 2));
     assert(!vc(2, 1));
   }
-  {
+  if (!std::is_constant_evaluated()) {
     using Comp = std::function<bool(int, int)>;
     using M    = std::flat_set<int, Comp>;
     Comp comp  = std::greater<int>();
@@ -67,10 +67,15 @@ void test() {
     assert(vc(1, 2));
     assert(!vc(2, 1));
   }
+
+  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/container.adaptors/flat.set/flat.set.operations/contains.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains.pass.cpp
index e0416fc261ffc..b039a3bbca4ff 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains.pass.cpp
@@ -23,7 +23,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   {
     using M = std::flat_set<Key, std::less<>, KeyContainer>;
@@ -66,15 +66,23 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.operations/contains_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains_transparent.pass.cpp
index 91f49305cd71b..914dc28769afe 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains_transparent.pass.cpp
@@ -35,7 +35,7 @@ static_assert(!CanContains<NonTransparentSet>);
 static_assert(!CanContains<const NonTransparentSet>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, TransparentComparator, KeyContainer>;
 
@@ -60,9 +60,12 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<std::string>>();
-  test_one<std::deque<std::string>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
   test_one<std::vector<std::string, min_allocator<std::string>>>();
 
@@ -82,10 +85,15 @@ void test() {
     assert(m.contains("beta"));
     assert(!m.contains("eta2"));
   }
+
+  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/container.adaptors/flat.set/flat.set.operations/count.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count.pass.cpp
index 51aec21ca212b..3c1fa261a3b2a 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count.pass.cpp
@@ -23,7 +23,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using S   = typename KeyContainer::size_type;
 
@@ -66,15 +66,23 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.operations/count_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count_transparent.pass.cpp
index 84e7b9a18b83b..182cf9d0eab3c 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count_transparent.pass.cpp
@@ -35,7 +35,7 @@ static_assert(!CanCount<NonTransparentSet>);
 static_assert(!CanCount<const NonTransparentSet>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, TransparentComparator, KeyContainer>;
   {
@@ -59,9 +59,12 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<std::string>>();
-  test_one<std::deque<std::string>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
   test_one<std::vector<std::string, min_allocator<std::string>>>();
 
@@ -81,10 +84,15 @@ void test() {
     assert(m.count("beta") == 1);
     assert(m.count("eta2") == 0);
   }
+
+  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/container.adaptors/flat.set/flat.set.operations/equal_range.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range.pass.cpp
index 7a8b19273289d..3ce9a49d24eb0 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range.pass.cpp
@@ -24,7 +24,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   {
     using M  = std::flat_set<Key, std::less<>, KeyContainer>;
@@ -74,15 +74,23 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.operations/equal_range_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range_transparent.pass.cpp
index 31081eb970397..76702fd1e3150 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range_transparent.pass.cpp
@@ -36,7 +36,7 @@ static_assert(!CanEqualRange<NonTransparentSet>);
 static_assert(!CanEqualRange<const NonTransparentSet>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, TransparentComparator, KeyContainer>;
 
@@ -87,9 +87,12 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<std::string>>();
-  test_one<std::deque<std::string>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
   test_one<std::vector<std::string, min_allocator<std::string>>>();
 
@@ -110,10 +113,15 @@ void test() {
     assert(first == m.begin() + 1);
     assert(last == m.begin() + 2);
   }
+
+  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/container.adaptors/flat.set/flat.set.operations/find.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find.pass.cpp
index 953b8fe638547..4786a59ce6124 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find.pass.cpp
@@ -25,7 +25,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, std::less<>, KeyContainer>;
   {
@@ -50,15 +50,23 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp
index b8d454c58f54c..ead22baf0eb92 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp
@@ -36,7 +36,7 @@ static_assert(!CanFind<NonTransparentSet>);
 static_assert(!CanFind<const NonTransparentSet>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, TransparentComparator, KeyContainer>;
 
@@ -77,8 +77,11 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<std::string>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
   test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
   test_one<std::vector<std::string, min_allocator<std::string>>>();
@@ -101,10 +104,15 @@ void test() {
     auto it2 = m.find("beta2");
     assert(it2 == m.end());
   }
+
+  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/container.adaptors/flat.set/flat.set.operations/lower_bound.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound.pass.cpp
index 32796b7a164f7..2a28769746bb4 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound.pass.cpp
@@ -24,7 +24,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   {
     using M = std::flat_set<Key, std::less<>, KeyContainer>;
@@ -66,15 +66,23 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.operations/lower_bound_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound_transparent.pass.cpp
index 0c3e25f795f33..5bb5d7f1e9736 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound_transparent.pass.cpp
@@ -36,7 +36,7 @@ static_assert(!CanLowerBound<NonTransparentSet>);
 static_assert(!CanLowerBound<const NonTransparentSet>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, TransparentComparator, KeyContainer>;
 
@@ -83,9 +83,12 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<std::string>>();
-  test_one<std::deque<std::string>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
   test_one<std::vector<std::string, min_allocator<std::string>>>();
 
@@ -107,10 +110,15 @@ void test() {
     auto it2 = m.lower_bound("beta2");
     assert(it2 == m.begin() + 2);
   }
+
+  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/container.adaptors/flat.set/flat.set.operations/upper_bound.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound.pass.cpp
index 6a967cb2371ba..487e11da214f3 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound.pass.cpp
@@ -24,7 +24,7 @@
 #include "min_allocator.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   {
     using M = std::flat_set<Key, std::less<>, KeyContainer>;
@@ -67,15 +67,23 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_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/container.adaptors/flat.set/flat.set.operations/upper_bound_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound_transparent.pass.cpp
index 36f2a20946496..becaaf9f6ef50 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound_transparent.pass.cpp
@@ -36,7 +36,7 @@ static_assert(!CanUpperBound<NonTransparentSet>);
 static_assert(!CanUpperBound<const NonTransparentSet>);
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
   using M   = std::flat_set<Key, TransparentComparator, KeyContainer>;
 
@@ -83,9 +83,12 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<std::string>>();
-  test_one<std::deque<std::string>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
   test_one<std::vector<std::string, min_allocator<std::string>>>();
 
@@ -107,10 +110,15 @@ void test() {
     auto it2 = m.upper_bound("beta2");
     assert(it2 == m.begin() + 2);
   }
+
+  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/container.adaptors/flat.set/helpers.h b/libcxx/test/std/containers/container.adaptors/flat.set/helpers.h
index 4cc720311cf01..3f0dc403e4bc1 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/helpers.h
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/helpers.h
@@ -20,7 +20,7 @@
 #include "test_macros.h"
 
 template <class... Args>
-void check_invariant(const std::flat_set<Args...>& m) {
+constexpr void check_invariant(const std::flat_set<Args...>& m) {
   assert(std::is_sorted(m.begin(), m.end(), m.key_comp()));
   auto key_equal = [&](const auto& x, const auto& y) {
     const auto& c = m.key_comp();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/incomplete_type.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/incomplete_type.pass.cpp
index faf746861df30..8c47a63631efa 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/incomplete_type.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/incomplete_type.pass.cpp
@@ -15,6 +15,7 @@
 
 #include <flat_set>
 #include <vector>
+#include "test_macros.h"
 
 struct A {
   using Set = std::flat_set<A>;
@@ -25,12 +26,18 @@ struct A {
 };
 
 // Implement the operator< required in order to instantiate flat_set<A>
-bool operator<(A const& L, A const& R) { return L.data < R.data; }
+constexpr bool operator<(A const& L, A const& R) { return L.data < R.data; }
 
-void test() { A a; }
+constexpr bool test() {
+  A a;
+  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/container.adaptors/flat.set/op_compare.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/op_compare.pass.cpp
index 3e7aecee77fdd..0526873009428 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/op_compare.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/op_compare.pass.cpp
@@ -31,7 +31,7 @@
 #include "test_container_comparisons.h"
 
 template <class KeyContainer>
-void test_one() {
+constexpr void test_one() {
   using Key = typename KeyContainer::value_type;
 
   {
@@ -69,9 +69,12 @@ void test_one() {
   }
 }
 
-void test() {
+constexpr bool test() {
   test_one<std::vector<int>>();
-  test_one<std::deque<int>>();
+#ifndef __cpp_lib_constexpr_deque
+  if (!std::is_constant_evaluated())
+#endif
+    test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
   test_one<std::vector<int, min_allocator<int>>>();
 
@@ -86,7 +89,7 @@ void test() {
   {
     // Comparisons use value_type's native operators, not the comparator
     struct StrongComp {
-      bool operator()(double a, double b) const { return std::strong_order(a, b) < 0; }
+      constexpr bool operator()(double a, double b) const { return std::strong_order(a, b) < 0; }
     };
     using C = std::flat_set<double, StrongComp>;
     C s1    = {1};
@@ -101,10 +104,15 @@ void test() {
     assert(s1 != s2);
     assert((s1 <=> s2) == std::partial_ordering::unordered);
   }
+
+  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/container.adaptors/flat_helpers.h b/libcxx/test/std/containers/container.adaptors/flat_helpers.h
index 57c4595ccfeb0..9913743b97917 100644
--- a/libcxx/test/std/containers/container.adaptors/flat_helpers.h
+++ b/libcxx/test/std/containers/container.adaptors/flat_helpers.h
@@ -9,6 +9,7 @@
 #ifndef TEST_STD_CONTAINERS_CONTAINER_ADAPTORS_FLAT_HELPERS_H
 #define TEST_STD_CONTAINERS_CONTAINER_ADAPTORS_FLAT_HELPERS_H
 
+#include <cstdint>
 #include <vector>
 
 #include "test_macros.h"
@@ -17,7 +18,7 @@ template <class T>
 struct CopyOnlyVector : std::vector<T> {
   using std::vector<T>::vector;
 
-  CopyOnlyVector(const CopyOnlyVector&) = default;
+  constexpr CopyOnlyVector(const CopyOnlyVector&) = default;
   constexpr CopyOnlyVector(CopyOnlyVector&& other) : CopyOnlyVector(other) {}
   constexpr CopyOnlyVector(CopyOnlyVector&& other, std::vector<T>::allocator_type alloc)
       : CopyOnlyVector(other, alloc) {}
@@ -26,18 +27,11 @@ struct CopyOnlyVector : std::vector<T> {
   constexpr CopyOnlyVector& operator=(CopyOnlyVector& other) { return this->operator=(other); }
 };
 
-template <class T>
-struct SillyReserveVector : std::vector<T> {
-  using std::vector<T>::vector;
-
-  void reserve(size_t) { this->clear(); }
-};
-
 template <class T, bool ConvertibleToT = false>
 struct Transparent {
   T t;
 
-  TEST_CONSTEXPR explicit operator T() const
+  constexpr explicit operator T() const
     requires ConvertibleToT
   {
     return t;
@@ -58,10 +52,10 @@ struct TransparentComparator {
 
   bool* transparent_used  = nullptr;
   TransparentComparator() = default;
-  TEST_CONSTEXPR TransparentComparator(bool& used) : transparent_used(&used) {}
+  constexpr TransparentComparator(bool& used) : transparent_used(&used) {}
 
   template <class T, bool Convertible>
-  TEST_CONSTEXPR bool operator()(const T& t, const Transparent<T, Convertible>& transparent) const {
+  constexpr bool operator()(const T& t, const Transparent<T, Convertible>& transparent) const {
     if (transparent_used != nullptr) {
       *transparent_used = true;
     }
@@ -69,7 +63,7 @@ struct TransparentComparator {
   }
 
   template <class T, bool Convertible>
-  TEST_CONSTEXPR bool operator()(const Transparent<T, Convertible>& transparent, const T& t) const {
+  constexpr bool operator()(const Transparent<T, Convertible>& transparent, const T& t) const {
     if (transparent_used != nullptr) {
       *transparent_used = true;
     }
@@ -77,7 +71,7 @@ struct TransparentComparator {
   }
 
   template <class T>
-  TEST_CONSTEXPR bool operator()(const T& t1, const T& t2) const {
+  constexpr bool operator()(const T& t1, const T& t2) const {
     return t1 < t2;
   }
 };

>From e871e4cf185587acaf4ab93c5bd93f056ed9f26a Mon Sep 17 00:00:00 2001
From: Hui Xie <hui.xie1990 at gmail.com>
Date: Sat, 17 May 2025 16:38:23 +0100
Subject: [PATCH 2/4] CI

---
 libcxx/include/__flat_set/flat_set.h                       | 4 ++--
 .../flat.set/flat.set.cons/sorted_iter_iter.pass.cpp       | 3 ++-
 .../flat.set/flat.set.operations/find_transparent.pass.cpp | 2 +-
 .../test/std/containers/container.adaptors/flat_helpers.h  | 7 +++++++
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/libcxx/include/__flat_set/flat_set.h b/libcxx/include/__flat_set/flat_set.h
index e677f67655842..95cb998459bc8 100644
--- a/libcxx/include/__flat_set/flat_set.h
+++ b/libcxx/include/__flat_set/flat_set.h
@@ -757,8 +757,8 @@ class flat_set {
   }
 
   template <class _Key2, class _Compare2, class _KeyContainer2, class _Predicate>
-  friend typename flat_set<_Key2, _Compare2, _KeyContainer2>::size_type
-  _LIBCPP_CONSTEXPR_SINCE_CXX26 erase_if(flat_set<_Key2, _Compare2, _KeyContainer2>&, _Predicate);
+  friend typename flat_set<_Key2, _Compare2, _KeyContainer2>::size_type _LIBCPP_CONSTEXPR_SINCE_CXX26
+  erase_if(flat_set<_Key2, _Compare2, _KeyContainer2>&, _Predicate);
 
   _KeyContainer __keys_;
   _LIBCPP_NO_UNIQUE_ADDRESS key_compare __compare_;
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp
index 2ebd3247abf42..4e445c448e64a 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp
@@ -34,7 +34,8 @@ constexpr void test() {
   {
     // flat_set(sorted_unique_t, InputIterator, InputIterator);
     // cpp17_input_iterator
-    using M  = std::flat_set<int, std::less<int>, KeyContainer>;
+    using M = std::flat_set<int, std::less<int>, KeyContainer>;
+
     int ar[] = {1, 2, 4, 5};
     auto m   = M(std::sorted_unique, cpp17_input_iterator<const int*>(ar), cpp17_input_iterator<const int*>(ar + 4));
     auto expected = M{1, 2, 4, 5};
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp
index ead22baf0eb92..4c65524919e5e 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp
@@ -82,7 +82,7 @@ constexpr bool test() {
 #ifndef __cpp_lib_constexpr_deque
   if (!std::is_constant_evaluated())
 #endif
-  test_one<std::deque<std::string>>();
+    test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
   test_one<std::vector<std::string, min_allocator<std::string>>>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat_helpers.h b/libcxx/test/std/containers/container.adaptors/flat_helpers.h
index 9913743b97917..45860bf15c644 100644
--- a/libcxx/test/std/containers/container.adaptors/flat_helpers.h
+++ b/libcxx/test/std/containers/container.adaptors/flat_helpers.h
@@ -27,6 +27,13 @@ struct CopyOnlyVector : std::vector<T> {
   constexpr CopyOnlyVector& operator=(CopyOnlyVector& other) { return this->operator=(other); }
 };
 
+template <class T>
+struct SillyReserveVector : std::vector<T> {
+  using std::vector<T>::vector;
+
+  constexpr void reserve(std::size_t) { this->clear(); }
+};
+
 template <class T, bool ConvertibleToT = false>
 struct Transparent {
   T t;

>From 82cd0c0a0dcb81aa5557522b6c1a82955cc8350d Mon Sep 17 00:00:00 2001
From: Hui Xie <hui.xie1990 at gmail.com>
Date: Sat, 21 Jun 2025 20:38:56 +0100
Subject: [PATCH 3/4] fix rebase

---
 libcxx/test/std/containers/Emplaceable.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libcxx/test/std/containers/Emplaceable.h b/libcxx/test/std/containers/Emplaceable.h
index e84a6381ab0f3..d8d3407791731 100644
--- a/libcxx/test/std/containers/Emplaceable.h
+++ b/libcxx/test/std/containers/Emplaceable.h
@@ -44,5 +44,13 @@ class Emplaceable {
   TEST_CONSTEXPR_CXX20 int get() const { return int_; }
 };
 
+template <>
+struct std::hash<Emplaceable> {
+  typedef Emplaceable argument_type;
+  typedef std::size_t result_type;
+
+  TEST_CONSTEXPR_CXX20 std::size_t operator()(const Emplaceable& x) const { return static_cast<std::size_t>(x.get()); }
+};
+
 #endif // TEST_STD_VER >= 11
 #endif // EMPLACEABLE_H

>From b318d1da296c7da8197276846cd80f414df9084e Mon Sep 17 00:00:00 2001
From: Hui Xie <hui.xie1990 at gmail.com>
Date: Sat, 5 Jul 2025 09:41:29 +0100
Subject: [PATCH 4/4] review

---
 .../flat.set/insert.temporary.pass.cpp         |  5 ++++-
 .../flat.set/insert_range.pass.cpp             | 18 ++++++++++++++----
 .../flat.set/flat.set.capacity/empty.pass.cpp  |  2 +-
 .../flat.set/flat.set.capacity/size.pass.cpp   |  4 ++--
 .../flat.set/flat.set.cons/alloc.pass.cpp      |  2 +-
 .../assign_initializer_list.pass.cpp           |  2 +-
 .../flat.set/flat.set.cons/compare.pass.cpp    |  2 +-
 .../flat.set/flat.set.cons/containers.pass.cpp |  2 +-
 .../flat.set/flat.set.cons/copy.pass.cpp       |  2 +-
 .../flat.set/flat.set.cons/copy_alloc.pass.cpp |  2 +-
 .../flat.set.cons/copy_assign.pass.cpp         |  4 ++--
 .../flat.set/flat.set.cons/default.pass.cpp    |  2 +-
 .../flat.set.cons/dtor_noexcept.pass.cpp       |  2 +-
 .../flat.set.cons/initializer_list.pass.cpp    |  4 ++--
 .../flat.set/flat.set.cons/iter_iter.pass.cpp  |  2 +-
 .../flat.set/flat.set.cons/move.pass.cpp       |  6 +++---
 .../flat.set/flat.set.cons/move_alloc.pass.cpp |  2 +-
 .../flat.set.cons/move_assign.pass.cpp         |  4 ++--
 .../flat.set/flat.set.cons/range.pass.cpp      |  2 +-
 .../flat.set.cons/sorted_container.pass.cpp    |  2 +-
 .../sorted_initializer_list.pass.cpp           |  4 ++--
 .../flat.set.cons/sorted_iter_iter.pass.cpp    |  4 ++--
 .../flat.set.erasure/erase_if.pass.cpp         |  2 +-
 .../flat.set.iterators/iterator.pass.cpp       |  2 +-
 .../iterator_comparison.pass.cpp               |  2 +-
 .../reverse_iterator.pass.cpp                  |  2 +-
 .../flat.set/flat.set.modifiers/clear.pass.cpp |  2 +-
 .../flat.set.modifiers/emplace.pass.cpp        |  4 ++--
 .../flat.set.modifiers/emplace_hint.pass.cpp   |  4 ++--
 .../flat.set.modifiers/erase_iter.pass.cpp     |  2 +-
 .../erase_iter_iter.pass.cpp                   |  2 +-
 .../flat.set.modifiers/erase_key.pass.cpp      |  2 +-
 .../erase_key_transparent.pass.cpp             |  4 ++--
 .../flat.set.modifiers/extract.pass.cpp        |  2 +-
 .../flat.set.modifiers/insert_cv.pass.cpp      |  2 +-
 .../insert_initializer_list.pass.cpp           |  2 +-
 .../flat.set.modifiers/insert_iter_cv.pass.cpp |  2 +-
 .../insert_iter_iter.pass.cpp                  |  2 +-
 .../flat.set.modifiers/insert_iter_rv.pass.cpp |  2 +-
 .../flat.set.modifiers/insert_range.pass.cpp   |  2 +-
 .../flat.set.modifiers/insert_rv.pass.cpp      |  2 +-
 .../insert_sorted_initializer_list.pass.cpp    |  2 +-
 .../insert_sorted_iter_iter.pass.cpp           |  2 +-
 .../insert_transparent.pass.cpp                |  2 +-
 .../flat.set.modifiers/replace.pass.cpp        |  2 +-
 .../flat.set.modifiers/swap_free.pass.cpp      |  2 +-
 .../flat.set.modifiers/swap_member.pass.cpp    |  2 +-
 .../flat.set/flat.set.observers/comp.pass.cpp  |  2 +-
 .../flat.set.operations/contains.pass.cpp      |  2 +-
 .../contains_transparent.pass.cpp              |  2 +-
 .../flat.set.operations/count.pass.cpp         |  2 +-
 .../count_transparent.pass.cpp                 |  2 +-
 .../flat.set.operations/equal_range.pass.cpp   |  2 +-
 .../equal_range_transparent.pass.cpp           |  2 +-
 .../flat.set/flat.set.operations/find.pass.cpp |  2 +-
 .../find_transparent.pass.cpp                  |  2 +-
 .../flat.set.operations/lower_bound.pass.cpp   |  2 +-
 .../lower_bound_transparent.pass.cpp           |  2 +-
 .../flat.set.operations/upper_bound.pass.cpp   |  2 +-
 .../upper_bound_transparent.pass.cpp           |  2 +-
 .../flat.set/op_compare.pass.cpp               |  2 +-
 61 files changed, 88 insertions(+), 75 deletions(-)

diff --git a/libcxx/test/libcxx/containers/container.adaptors/flat.set/insert.temporary.pass.cpp b/libcxx/test/libcxx/containers/container.adaptors/flat.set/insert.temporary.pass.cpp
index e71f35129ddac..22e0662cf2c63 100644
--- a/libcxx/test/libcxx/containers/container.adaptors/flat.set/insert.temporary.pass.cpp
+++ b/libcxx/test/libcxx/containers/container.adaptors/flat.set/insert.temporary.pass.cpp
@@ -21,7 +21,7 @@
 #include "../flat_helpers.h"
 #include "test_macros.h"
 
-bool test() {
+constexpr bool test() {
   using M = std::flat_set<TrackCopyMove>;
   {
     M m;
@@ -43,6 +43,9 @@ bool test() {
 
 int main(int, char**) {
   test();
+#if TEST_STD_VER >= 26
+  static_assert(test());
+#endif
 
   return 0;
 }
diff --git a/libcxx/test/libcxx/containers/container.adaptors/flat.set/insert_range.pass.cpp b/libcxx/test/libcxx/containers/container.adaptors/flat.set/insert_range.pass.cpp
index 35b9737e85106..c9dcd71127e2b 100644
--- a/libcxx/test/libcxx/containers/container.adaptors/flat.set/insert_range.pass.cpp
+++ b/libcxx/test/libcxx/containers/container.adaptors/flat.set/insert_range.pass.cpp
@@ -24,23 +24,33 @@
 #include <vector>
 
 #include "../flat_helpers.h"
+#include "test_iterators.h"
 #include "test_macros.h"
 
-void test() {
+constexpr bool test() {
   NotQuiteSequenceContainer<int> v;
   std::flat_set s(v);
-  std::istringstream ints("0 1 1 0");
-  auto r = std::ranges::subrange(std::istream_iterator<int>(ints), std::istream_iterator<int>()) |
-           std::views::transform([](int i) { return i * i; });
+
+  int ar[]   = {0, 1, 1, 0};
+  using Iter = cpp20_input_iterator<const int*>;
+  using Sent = sentinel_wrapper<Iter>;
+  using R    = std::ranges::subrange<Iter, Sent>;
+  auto r     = R(Iter(ar), Sent(Iter(ar + 4)));
+
   static_assert(
       ![](auto& t) { return requires { t.insert_range(t.end(), r); }; }(v),
       "This test is to test the case where the underlying container does not provide insert_range");
   s.insert_range(r);
   assert(std::ranges::equal(s, std::vector<int>{0, 1}));
+
+  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/container.adaptors/flat.set/flat.set.capacity/empty.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/empty.pass.cpp
index 076102c616d44..e0afa752b5a95 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/empty.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/empty.pass.cpp
@@ -41,7 +41,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/size.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/size.pass.cpp
index 278d5ea2cdefd..4c4de89f58ba3 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/size.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.capacity/size.pass.cpp
@@ -47,7 +47,7 @@ constexpr void test_one() {
   }
   {
     M m;
-    S s = std::is_constant_evaluated() ? 100 : 1000000;
+    S s = TEST_IS_CONSTANT_EVALUATED ? 100 : 1000000;
     for (auto i = 0u; i < s; ++i) {
       m.emplace(i);
     }
@@ -60,7 +60,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/alloc.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/alloc.pass.cpp
index 00a0d4849c2ed..3b7a3550391f5 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/alloc.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/alloc.pass.cpp
@@ -63,7 +63,7 @@ constexpr void test() {
 constexpr bool test() {
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/assign_initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/assign_initializer_list.pass.cpp
index 44ac9d1a9040d..388a515893bd9 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/assign_initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/assign_initializer_list.pass.cpp
@@ -49,7 +49,7 @@ constexpr bool test() {
   test_one<std::vector<int>>();
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/compare.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/compare.pass.cpp
index 814445f91c17f..712f33a7b7f8a 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/compare.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/compare.pass.cpp
@@ -95,7 +95,7 @@ constexpr bool test() {
   test_compare_alloc<std::vector>();
 
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
   {
     test_compare<std::deque<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/containers.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/containers.pass.cpp
index aaaa19a8a6d33..ea775ebd19bec 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/containers.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/containers.pass.cpp
@@ -156,7 +156,7 @@ constexpr bool test() {
   test<std::vector>();
 
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy.pass.cpp
index 343725c294971..5864d7d751b12 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy.pass.cpp
@@ -66,7 +66,7 @@ constexpr void test() {
 constexpr bool test() {
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_alloc.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_alloc.pass.cpp
index 779d0f8132708..108a3cf1c4968 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_alloc.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_alloc.pass.cpp
@@ -63,7 +63,7 @@ constexpr bool test() {
 
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_assign.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_assign.pass.cpp
index 0a43c3c03aa39..59caa9c1f8a48 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_assign.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/copy_assign.pass.cpp
@@ -66,7 +66,7 @@ constexpr void test() {
     auto keys2 = std::move(mo).extract();
     assert(keys2.get_allocator() == other_allocator<int>(6));
   }
-  if (!std::is_constant_evaluated()) {
+  if (!TEST_IS_CONSTANT_EVALUATED) {
     // comparator is copied and invariant is preserved
     using M = std::flat_set<int, std::function<bool(int, int)>, KeyContainer<int>>;
     M mo    = M({1, 2}, std::less<int>());
@@ -98,7 +98,7 @@ constexpr void test() {
 constexpr bool test() {
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/default.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/default.pass.cpp
index c7ab9d20f999b..75eba28b61bd5 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/default.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/default.pass.cpp
@@ -93,7 +93,7 @@ constexpr void test() {
 constexpr bool test() {
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/dtor_noexcept.pass.cpp
index f7a8f8719c22f..810b13b0a5b0b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/dtor_noexcept.pass.cpp
@@ -58,7 +58,7 @@ constexpr void test() {
 constexpr bool test() {
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/initializer_list.pass.cpp
index 55eabcee578c3..2a8e4c40ebe2b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/initializer_list.pass.cpp
@@ -89,7 +89,7 @@ constexpr void test() {
     assert(m2 == m);
     assert(m2.key_comp() == C(10));
   }
-  if (!std::is_constant_evaluated()) {
+  if (!TEST_IS_CONSTANT_EVALUATED) {
     // flat_set(initializer_list<value_type>, const key_compare&);
     // Sorting uses the comparator that was passed in
     using M = std::flat_set<int, std::function<bool(int, int)>, KeyContainer<int, min_allocator<int>>>;
@@ -151,7 +151,7 @@ constexpr bool test() {
 
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/iter_iter.pass.cpp
index 4d64e560ce231..256f01a7b2f12 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/iter_iter.pass.cpp
@@ -150,7 +150,7 @@ constexpr bool test() {
   test_alloc<std::vector>();
 
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
   {
     test<std::deque<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move.pass.cpp
index 17c4b3550a784..fcc15edc2935b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move.pass.cpp
@@ -55,7 +55,7 @@ constexpr void test() {
     assert(mo.key_comp() == C(5));
     assert(std::move(mo).extract().get_allocator() == A());
   }
-  if (!std::is_constant_evaluated()) {
+  if (!TEST_IS_CONSTANT_EVALUATED) {
     // A moved-from flat_set maintains its class invariant in the presence of moved-from comparators.
     using M = std::flat_set<int, std::function<bool(int, int)>, KeyContainer<int>>;
     M mo    = M({1, 2, 3}, std::less<int>());
@@ -115,7 +115,7 @@ constexpr void test_move_noexcept() {
     C d = std::move(c);
   }
 #if _LIBCPP_VERSION
-  if (!std::is_constant_evaluated()) {
+  if (!TEST_IS_CONSTANT_EVALUATED) {
     // Container fails to be nothrow-move-constructible; this relies on libc++'s support for non-nothrow-copyable allocators
     using C = std::flat_set<int, std::less<int>, std::deque<int, ThrowingMoveAllocator<int>>>;
     static_assert(!std::is_nothrow_move_constructible_v<std::deque<int, ThrowingMoveAllocator<int>>>);
@@ -137,7 +137,7 @@ constexpr bool test() {
   test<std::vector>();
   test_move_noexcept<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
   {
     test<std::deque>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_alloc.pass.cpp
index a2253208422d5..9e88cbb002da5 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_alloc.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_alloc.pass.cpp
@@ -77,7 +77,7 @@ constexpr bool test() {
 
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_assign.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_assign.pass.cpp
index f54acea41e3c7..1c3affe05d10f 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_assign.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/move_assign.pass.cpp
@@ -116,7 +116,7 @@ constexpr void test_move_assign_clears() {
     LIBCPP_ASSERT(m1.empty());
   }
 #if !defined(TEST_HAS_NO_EXCEPTIONS)
-  if (!std::is_constant_evaluated()) {
+  if (!TEST_IS_CONSTANT_EVALUATED) {
     using M = std::flat_set<int, std::less<>, MoveAssignThrows>;
     M m1    = {1, 2, 3};
     M m2    = {1, 2};
@@ -239,7 +239,7 @@ constexpr bool test() {
   test_move_assign_clears<std::vector>();
 
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
   {
     test<std::deque>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/range.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/range.pass.cpp
index 75b7a7d66ad48..031c035bf5bf8 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/range.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/range.pass.cpp
@@ -186,7 +186,7 @@ constexpr bool test() {
   test_alloc<std::vector>();
 
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
   {
     test<std::deque<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_container.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_container.pass.cpp
index 32dd0b6586675..5cf6d4c23f4e9 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_container.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_container.pass.cpp
@@ -145,7 +145,7 @@ constexpr bool test() {
 
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_initializer_list.pass.cpp
index 993a01208fb76..00cebb60950fc 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_initializer_list.pass.cpp
@@ -49,7 +49,7 @@ constexpr void test() {
     M m2 = {std::sorted_unique, il1};
     assert(m2 == m);
   }
-  if (!std::is_constant_evaluated()) {
+  if (!TEST_IS_CONSTANT_EVALUATED) {
     // flat_set(sorted_unique_t, initializer_list<value_type>, const key_compare&);
     using M = std::flat_set<int, std::function<bool(int, int)>, KeyContainer<int>>;
     auto m  = M(std::sorted_unique, il1, std::less<int>());
@@ -151,7 +151,7 @@ constexpr bool test() {
 
   test<std::vector>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test<std::deque>();
 
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp
index 4e445c448e64a..7ffb09e7347c4 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.cons/sorted_iter_iter.pass.cpp
@@ -55,7 +55,7 @@ constexpr void test() {
     auto expected = M{1, 2, 4, 5};
     assert(m == expected);
   }
-  if (!std::is_constant_evaluated()) {
+  if (!TEST_IS_CONSTANT_EVALUATED) {
     // flat_set(sorted_unique_t, InputIterator, InputIterator, const key_compare&);
     // cpp_17_input_iterator
     using M  = std::flat_set<int, std::function<bool(int, int)>, KeyContainer>;
@@ -168,7 +168,7 @@ constexpr bool test() {
   test_alloc<std::vector>();
 
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
   {
     test<std::deque<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.erasure/erase_if.pass.cpp
index fafbf46f13acb..924fbdab5de98 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.erasure/erase_if.pass.cpp
@@ -89,7 +89,7 @@ constexpr bool test() {
   test_one<std::flat_set<int, std::less<int>, std::vector<int, min_allocator<int>>>>();
   test_one<std::flat_set<int, std::greater<int>, std::vector<int, test_allocator<int>>>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
   {
     test_one<std::flat_set<int, std::less<int>, std::deque<int, min_allocator<int>>>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator.pass.cpp
index 4b4abba094459..8aafa97818bc7 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator.pass.cpp
@@ -70,7 +70,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator_comparison.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator_comparison.pass.cpp
index c639c23d7ffa8..fbc519cba98de 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator_comparison.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/iterator_comparison.pass.cpp
@@ -144,7 +144,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp
index 81ca5cd003204..3725333f1f109 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp
@@ -87,7 +87,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/clear.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/clear.pass.cpp
index e3e5068fa06f8..f92609fc34550 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/clear.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/clear.pass.cpp
@@ -61,7 +61,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cpp
index 1e615f94fee16..de8c05c48c244 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cpp
@@ -124,7 +124,7 @@ constexpr void test_emplaceable() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
@@ -132,7 +132,7 @@ constexpr bool test() {
 
   test_emplaceable<std::vector<Emplaceable>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_emplaceable<std::deque<Emplaceable>>();
   test_emplaceable<MinSequenceContainer<Emplaceable>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cpp
index 27cd740eca64d..0b5aab1b1c61e 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cpp
@@ -137,7 +137,7 @@ constexpr void test_emplaceable() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
@@ -145,7 +145,7 @@ constexpr bool test() {
 
   test_emplaceable<std::vector<Emplaceable>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_emplaceable<std::deque<Emplaceable>>();
   test_emplaceable<MinSequenceContainer<Emplaceable>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter.pass.cpp
index 1ec4dc89f6516..c908f5d63b879 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter.pass.cpp
@@ -97,7 +97,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter_iter.pass.cpp
index ce5c214706c6b..bc53e306851b8 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_iter_iter.pass.cpp
@@ -81,7 +81,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key.pass.cpp
index c2e857e566ff7..c5d4cd1052b1f 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key.pass.cpp
@@ -78,7 +78,7 @@ constexpr bool test() {
   test_one<std::vector<int>>();
   test_one<std::vector<int>, std::greater<>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key_transparent.pass.cpp
index 98c3298306d60..b6701e36a55a9 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/erase_key_transparent.pass.cpp
@@ -98,7 +98,7 @@ constexpr void test_transparent_comparator() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
@@ -106,7 +106,7 @@ constexpr bool test() {
 
   test_transparent_comparator<std::vector<std::string>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_transparent_comparator<std::deque<std::string>>();
   test_transparent_comparator<MinSequenceContainer<std::string>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/extract.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/extract.pass.cpp
index 23a3e93c7958b..b554ef8154909 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/extract.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/extract.pass.cpp
@@ -58,7 +58,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cpp
index 227969700f051..2e59818b48286 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cpp
@@ -62,7 +62,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_initializer_list.pass.cpp
index 9a717a1c39f9f..ad6f379b091ef 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_initializer_list.pass.cpp
@@ -70,7 +70,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cpp
index 914640fd8e0fd..710f83f78ecb3 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cpp
@@ -58,7 +58,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_iter.pass.cpp
index c7b74d44d6009..af25de9b1af39 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_iter.pass.cpp
@@ -78,7 +78,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cpp
index 191f06f64239b..a1fb10115bffa 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cpp
@@ -53,7 +53,7 @@ constexpr bool test() {
   test_one<std::vector<int>>();
   test_one<std::vector<MoveOnly>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
   {
     test_one<std::deque<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_range.pass.cpp
index 90e7ce9f53c99..a624f9161a985 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_range.pass.cpp
@@ -86,7 +86,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cpp
index f0180f6899361..b5272f2ae6e2b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cpp
@@ -61,7 +61,7 @@ constexpr bool test() {
   test_one<std::vector<int>>();
   test_one<std::vector<MoveOnly>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
   {
     test_one<std::deque<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_initializer_list.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_initializer_list.pass.cpp
index 479340cd4e5e1..bc6476bfaaacb 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_initializer_list.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_initializer_list.pass.cpp
@@ -50,7 +50,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_iter_iter.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_iter_iter.pass.cpp
index 5abeacebff6e7..5287dbec19294 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_sorted_iter_iter.pass.cpp
@@ -63,7 +63,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp
index ae6de12528e6e..3d5c954c5e316 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp
@@ -108,7 +108,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/replace.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/replace.pass.cpp
index dd783692e3d60..c15266676c61b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/replace.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/replace.pass.cpp
@@ -54,7 +54,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_free.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_free.pass.cpp
index f86fa0cffed6a..6b4a65e4701b2 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_free.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_free.pass.cpp
@@ -87,7 +87,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_member.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_member.pass.cpp
index 7ce42ed4d935a..a3b605ee94cfb 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_member.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.modifiers/swap_member.pass.cpp
@@ -85,7 +85,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.observers/comp.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.observers/comp.pass.cpp
index 232c7c2bc9e93..b1c667a879cef 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.observers/comp.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.observers/comp.pass.cpp
@@ -36,7 +36,7 @@ constexpr bool test() {
     assert(vc(1, 2));
     assert(!vc(2, 1));
   }
-  if (!std::is_constant_evaluated()) {
+  if (!TEST_IS_CONSTANT_EVALUATED) {
     using Comp = std::function<bool(int, int)>;
     using M    = std::flat_set<int, Comp>;
     Comp comp  = std::greater<int>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains.pass.cpp
index b039a3bbca4ff..cb2b3da891384 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains.pass.cpp
@@ -69,7 +69,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains_transparent.pass.cpp
index 914dc28769afe..d7e45f6b706b1 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/contains_transparent.pass.cpp
@@ -63,7 +63,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<std::string>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count.pass.cpp
index 3c1fa261a3b2a..b2c646e3ecf22 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count.pass.cpp
@@ -69,7 +69,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count_transparent.pass.cpp
index 182cf9d0eab3c..8686db3d400e5 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/count_transparent.pass.cpp
@@ -62,7 +62,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<std::string>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range.pass.cpp
index 3ce9a49d24eb0..69e5f1b18cb28 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range.pass.cpp
@@ -77,7 +77,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range_transparent.pass.cpp
index 76702fd1e3150..e6667c363963a 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/equal_range_transparent.pass.cpp
@@ -90,7 +90,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<std::string>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find.pass.cpp
index 4786a59ce6124..daf9b70fdcc34 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find.pass.cpp
@@ -53,7 +53,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp
index 4c65524919e5e..d952ba941896b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/find_transparent.pass.cpp
@@ -80,7 +80,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<std::string>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound.pass.cpp
index 2a28769746bb4..f5e6c7c06e462 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound.pass.cpp
@@ -69,7 +69,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound_transparent.pass.cpp
index 5bb5d7f1e9736..3b24e051e9991 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/lower_bound_transparent.pass.cpp
@@ -86,7 +86,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<std::string>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound.pass.cpp
index 487e11da214f3..c669746862dd5 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound.pass.cpp
@@ -70,7 +70,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound_transparent.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound_transparent.pass.cpp
index becaaf9f6ef50..dda8858f2683a 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound_transparent.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.operations/upper_bound_transparent.pass.cpp
@@ -86,7 +86,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<std::string>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<std::string>>();
   test_one<MinSequenceContainer<std::string>>();
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/op_compare.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/op_compare.pass.cpp
index 0526873009428..a8284389efd1b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/op_compare.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/op_compare.pass.cpp
@@ -72,7 +72,7 @@ constexpr void test_one() {
 constexpr bool test() {
   test_one<std::vector<int>>();
 #ifndef __cpp_lib_constexpr_deque
-  if (!std::is_constant_evaluated())
+  if (!TEST_IS_CONSTANT_EVALUATED)
 #endif
     test_one<std::deque<int>>();
   test_one<MinSequenceContainer<int>>();



More information about the libcxx-commits mailing list