[libcxx-commits] [libcxx] [libc++] Add an initial modulemap for the test support headers (PR #162800)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Oct 10 03:12:19 PDT 2025
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/162800
>From f06b30863ef7b285ffca5c14a5cf67e1087a2b74 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Fri, 10 Oct 2025 10:19:27 +0200
Subject: [PATCH] [libc++] Add an initial modulemap for the test support
headers
---
libcxx/include/__ranges/iota_view.h | 9 +++++----
libcxx/include/module.modulemap.in | 5 ++++-
.../copy_move_unwrap_reverse.pass.cpp | 1 +
libcxx/test/libcxx/memory/allocation_guard.pass.cpp | 2 ++
.../alg.contains/ranges.contains_subrange.pass.cpp | 1 +
.../alg.nonmodifying/alg.count/count.pass.cpp | 1 +
.../alg.count/ranges.count.pass.cpp | 1 +
.../alg.ends_with/ranges.ends_with.pass.cpp | 2 ++
.../alg.starts_with/ranges.starts_with.pass.cpp | 1 +
.../alg.partitions/pstl.is_partitioned.pass.cpp | 1 +
.../associative/map/map.cons/dtor_noexcept.pass.cpp | 3 ++-
.../multimap/multimap.cons/dtor_noexcept.pass.cpp | 3 ++-
.../multiset/multiset.cons/dtor_noexcept.pass.cpp | 3 ++-
.../associative/set/set.cons/dtor_noexcept.pass.cpp | 3 ++-
.../flat.map/flat.map.cons/dtor_noexcept.pass.cpp | 1 +
.../container.adaptors/flat.map/helpers.h | 1 +
.../flat.multimap.cons/dtor_noexcept.pass.cpp | 1 +
.../container.adaptors/flat.multimap/helpers.h | 1 +
.../flat.multiset.cons/copy_assign.pass.cpp | 1 +
.../flat.multiset.cons/dtor_noexcept.pass.cpp | 1 +
.../flat.set/flat.set.cons/dtor_noexcept.pass.cpp | 1 +
.../stack/stack.cons/ctor_iterators.pass.cpp | 1 +
.../deque/deque.cons/dtor_noexcept.pass.cpp | 3 ++-
.../forwardlist.cons/dtor_noexcept.pass.cpp | 3 ++-
.../sequences/list/list.cons/dtor_noexcept.pass.cpp | 3 ++-
.../sequences/vector.bool/assign_move.pass.cpp | 1 +
.../sequences/vector.bool/default_noexcept.pass.cpp | 3 ++-
.../sequences/vector.bool/dtor_noexcept.pass.cpp | 3 ++-
.../vector.bool/move_assign_noexcept.pass.cpp | 3 ++-
.../sequences/vector.bool/move_noexcept.pass.cpp | 3 ++-
.../vector/vector.cons/dtor_noexcept.pass.cpp | 3 ++-
.../unord.map.cnstr/dtor_noexcept.pass.cpp | 3 ++-
.../unord.multimap.cnstr/dtor_noexcept.pass.cpp | 3 ++-
.../unord.multiset.cnstr/dtor_noexcept.pass.cpp | 3 ++-
.../unord.set.cnstr/dtor_noexcept.pass.cpp | 3 ++-
.../class.path/path.member/path.append.pass.cpp | 1 +
.../class.path/path.member/path.concat.pass.cpp | 1 +
libcxx/test/std/numerics/c.math/signbit.pass.cpp | 1 +
.../range.iota.view/indices.pass.cpp | 1 -
.../iterator/member_typedefs.compile.pass.cpp | 8 ++++++++
.../re/re.results/re.results.const/move.pass.cpp | 4 +++-
.../strings/basic.string/string.cons/dtor.pass.cpp | 5 +++--
.../string.cons/iter_alloc_deduction.pass.cpp | 1 +
.../string.cons/string_view_deduction.pass.cpp | 13 +++++++------
.../string_view_size_size_deduction.pass.cpp | 11 ++++++-----
.../uses_allocator_construction_args.pass.cpp | 1 +
libcxx/test/support/module.modulemap | 10 ++++++++++
47 files changed, 102 insertions(+), 36 deletions(-)
create mode 100644 libcxx/test/support/module.modulemap
diff --git a/libcxx/include/__ranges/iota_view.h b/libcxx/include/__ranges/iota_view.h
index 22adc22e69190..e34fecca49d6b 100644
--- a/libcxx/include/__ranges/iota_view.h
+++ b/libcxx/include/__ranges/iota_view.h
@@ -58,11 +58,12 @@ struct __get_wider_signed {
return type_identity<int>{};
else if constexpr (sizeof(_Int) < sizeof(long))
return type_identity<long>{};
- else
+ else if constexpr (sizeof(_Int) < sizeof(long long))
return type_identity<long long>{};
-
- static_assert(
- sizeof(_Int) <= sizeof(long long), "Found integer-like type that is bigger than largest integer like type.");
+ else if constexpr (sizeof(_Int) <= sizeof(__int128_t))
+ return type_identity<__int128_t>{};
+ else
+ static_assert(false, "Found integer-like type that is bigger than largest integer like type.");
}
using type = typename decltype(__call())::type;
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index 894093b409e11..45950c4141c98 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -2359,7 +2359,10 @@ module std [system] {
module hash_table { header "__hash_table" }
module node_handle { header "__node_handle" }
module split_buffer { header "__split_buffer" }
- module tree { header "__tree" }
+ module tree {
+ header "__tree"
+ export std.memory.unique_ptr
+ }
module std_mbstate_t {
header "__std_mbstate_t.h"
export *
diff --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
index 2a85e7b5ddcc3..22444624dcba7 100644
--- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
@@ -19,6 +19,7 @@
#include <cstdint>
#include <iterator>
#include <type_traits>
+#include <utility>
#include "test_iterators.h"
diff --git a/libcxx/test/libcxx/memory/allocation_guard.pass.cpp b/libcxx/test/libcxx/memory/allocation_guard.pass.cpp
index 493ebf044187c..a7c93972d656d 100644
--- a/libcxx/test/libcxx/memory/allocation_guard.pass.cpp
+++ b/libcxx/test/libcxx/memory/allocation_guard.pass.cpp
@@ -17,6 +17,8 @@
#include <__memory/allocation_guard.h>
#include <cassert>
+#include <climits>
+#include <memory>
#include <type_traits>
#include <utility>
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains_subrange.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains_subrange.pass.cpp
index 890ac23fff832..8354894493e21 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains_subrange.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains_subrange.pass.cpp
@@ -32,6 +32,7 @@
#include "almost_satisfies_types.h"
#include "test_iterators.h"
+#include "type_algorithms.h"
struct NotEqualityComparable {};
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp
index e696dcdb34351..80f76150318ae 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp
@@ -20,6 +20,7 @@
#include <algorithm>
#include <cassert>
#include <cstddef>
+#include <cstdint>
#include <vector>
#include "sized_allocator.h"
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.count/ranges.count.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.count/ranges.count.pass.cpp
index 2c1346a743746..9d9d7ed5ab177 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.count/ranges.count.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.count/ranges.count.pass.cpp
@@ -26,6 +26,7 @@
#include <array>
#include <cassert>
#include <cstddef>
+#include <cstdint>
#include <ranges>
#include <vector>
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.ends_with/ranges.ends_with.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.ends_with/ranges.ends_with.pass.cpp
index 199e6a786e5ba..76c62ffa760ad 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.ends_with/ranges.ends_with.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.ends_with/ranges.ends_with.pass.cpp
@@ -25,8 +25,10 @@
#include <array>
#include <chrono>
#include <ranges>
+
#include "almost_satisfies_types.h"
#include "test_iterators.h"
+#include "type_algorithms.h"
using namespace std::chrono;
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.starts_with/ranges.starts_with.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.starts_with/ranges.starts_with.pass.cpp
index 0f2284edde81c..172fa82fccc29 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.starts_with/ranges.starts_with.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.starts_with/ranges.starts_with.pass.cpp
@@ -27,6 +27,7 @@
#include "almost_satisfies_types.h"
#include "test_iterators.h"
+#include "type_algorithms.h"
template <class Iter1, class Sent1 = Iter1, class Iter2 = int*, class Sent2 = Iter2>
concept HasStartsWithIt = requires(Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2) {
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.partitions/pstl.is_partitioned.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.partitions/pstl.is_partitioned.pass.cpp
index a80e2f6ddc637..b64242dfc14b6 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.partitions/pstl.is_partitioned.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.partitions/pstl.is_partitioned.pass.cpp
@@ -20,6 +20,7 @@
#include "test_iterators.h"
#include "test_execution_policies.h"
+#include "type_algorithms.h"
template <class Iter>
struct Test {
diff --git a/libcxx/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
index 8497b942ad8eb..c9f7f281391f5 100644
--- a/libcxx/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <map>
#include <cassert>
+#include <map>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
index 62afae92b6902..c757befb9211c 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <map>
#include <cassert>
+#include <map>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
index 987eca0706076..bf5d256e19a0f 100644
--- a/libcxx/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <set>
#include <cassert>
+#include <set>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
index 63c0433477414..a382ce629d284 100644
--- a/libcxx/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <set>
#include <cassert>
+#include <set>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/dtor_noexcept.pass.cpp
index 4562b01bc8c42..9e8198443387b 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/dtor_noexcept.pass.cpp
@@ -17,6 +17,7 @@
#include <flat_map>
#include <functional>
#include <vector>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/container.adaptors/flat.map/helpers.h b/libcxx/test/std/containers/container.adaptors/flat.map/helpers.h
index 932f330db829e..445de4fcb6eae 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.map/helpers.h
+++ b/libcxx/test/std/containers/container.adaptors/flat.map/helpers.h
@@ -15,6 +15,7 @@
#include <vector>
#include <flat_map>
#include <ranges>
+#include <type_traits>
#include "../flat_helpers.h"
#include "test_allocator.h"
diff --git a/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.multimap.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.multimap.cons/dtor_noexcept.pass.cpp
index 104d56755bd76..2534a4748aa76 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.multimap.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.multimap.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <deque>
#include <flat_map>
#include <functional>
+#include <type_traits>
#include <vector>
#include "test_macros.h"
diff --git a/libcxx/test/std/containers/container.adaptors/flat.multimap/helpers.h b/libcxx/test/std/containers/container.adaptors/flat.multimap/helpers.h
index f3edd3b3a0242..ccb3218ebfc41 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.multimap/helpers.h
+++ b/libcxx/test/std/containers/container.adaptors/flat.multimap/helpers.h
@@ -15,6 +15,7 @@
#include <vector>
#include <flat_map>
#include <ranges>
+#include <type_traits>
#include "../flat_helpers.h"
#include "test_allocator.h"
diff --git a/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/copy_assign.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/copy_assign.pass.cpp
index 2b6176ac915a7..668f30c4f11c5 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/copy_assign.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/copy_assign.pass.cpp
@@ -15,6 +15,7 @@
#include <algorithm>
#include <flat_set>
#include <functional>
+#include <utility>
#include <vector>
#include "operator_hijacker.h"
diff --git a/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/dtor_noexcept.pass.cpp
index f852f2f85572c..224ac0f92b515 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <deque>
#include <flat_set>
#include <functional>
+#include <type_traits>
#include <vector>
#include "test_macros.h"
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 810b13b0a5b0b..1caf58fff72d3 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
@@ -16,6 +16,7 @@
#include <deque>
#include <flat_set>
#include <functional>
+#include <type_traits>
#include <vector>
#include "test_macros.h"
diff --git a/libcxx/test/std/containers/container.adaptors/stack/stack.cons/ctor_iterators.pass.cpp b/libcxx/test/std/containers/container.adaptors/stack/stack.cons/ctor_iterators.pass.cpp
index 5981f9189dbfb..afd5a63895b80 100644
--- a/libcxx/test/std/containers/container.adaptors/stack/stack.cons/ctor_iterators.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/stack/stack.cons/ctor_iterators.pass.cpp
@@ -15,6 +15,7 @@
#include <cassert>
#include <stack>
+#include <type_traits>
#include "test_allocator.h"
diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
index f0a839484f9dc..338a0fa6b832d 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <deque>
#include <cassert>
+#include <deque>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
index 64c60af1fdcb7..8d474cf966339 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <forward_list>
#include <cassert>
+#include <forward_list>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
index 44e6ddd722a70..4ebe19fafef29 100644
--- a/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <list>
#include <cassert>
+#include <list>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
index 8791380b134c7..2200367fb27f7 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
@@ -14,6 +14,7 @@
// vector& operator=(vector&& c);
#include <cassert>
+#include <utility>
#include <vector>
#include "min_allocator.h"
diff --git a/libcxx/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
index 0801709625090..a95d358248f56 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
@@ -16,8 +16,9 @@
// For vector<>, this was added to the standard by N4258,
// but vector<bool> was not changed.
-#include <vector>
#include <cassert>
+#include <vector>
+#include <type_traits>
#include "test_macros.h"
#include "test_allocator.h"
diff --git a/libcxx/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
index f8f3c76f8c3d9..6a6ca6b36ce5d 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <vector>
#include <cassert>
+#include <vector>
+#include <type_traits>
#include "test_macros.h"
#include "test_allocator.h"
diff --git a/libcxx/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
index 5a69213c3b4ef..e5add73b167d0 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
@@ -17,8 +17,9 @@
// UNSUPPORTED: c++03
-#include <vector>
#include <cassert>
+#include <vector>
+#include <type_traits>
#include "test_macros.h"
#include "test_allocator.h"
diff --git a/libcxx/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
index d0d231f48953a..5bdae01f871f9 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
@@ -15,8 +15,9 @@
// UNSUPPORTED: c++03
-#include <vector>
#include <cassert>
+#include <vector>
+#include <type_traits>
#include "test_macros.h"
#include "test_allocator.h"
diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
index 4a7e2cf445676..331b360c2fa1d 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <vector>
#include <cassert>
+#include <vector>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp
index 5797599b1f9e4..cf148fd75732b 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <unordered_map>
#include <cassert>
+#include <unordered_map>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp
index 6fdc9e3eb7f5e..2771e64b36ea8 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <unordered_map>
#include <cassert>
+#include <unordered_map>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp
index 32c757e16d344..c48c2865b844f 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <unordered_set>
#include <cassert>
+#include <unordered_set>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp
index 17cfae0f989c7..2939e36dd6e0d 100644
--- a/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <unordered_set>
#include <cassert>
+#include <unordered_set>
+#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"
diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
index b3d87ee630873..65c4dabe47d66 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
@@ -32,6 +32,7 @@
#include <type_traits>
#include <string_view>
#include <cassert>
+#include <utility>
// On Windows, the append function converts all inputs (pointers, iterators)
// to an intermediate path object, causing allocations in cases where no
diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
index 96de72b355f3f..d4a32735dc05a 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
@@ -39,6 +39,7 @@
#include <string>
#include <string_view>
#include <cassert>
+#include <utility>
// On Windows, charset conversions cause allocations in the path class in
// cases where no allocations are done on other platforms.
diff --git a/libcxx/test/std/numerics/c.math/signbit.pass.cpp b/libcxx/test/std/numerics/c.math/signbit.pass.cpp
index 7571ced2e4431..4f1119b95f625 100644
--- a/libcxx/test/std/numerics/c.math/signbit.pass.cpp
+++ b/libcxx/test/std/numerics/c.math/signbit.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <cmath>
#include <limits>
+#include <type_traits>
#include "test_macros.h"
#include "type_algorithms.h"
diff --git a/libcxx/test/std/ranges/range.factories/range.iota.view/indices.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/indices.pass.cpp
index d92b6cb876a40..08a0774298f68 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/indices.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/indices.pass.cpp
@@ -18,7 +18,6 @@
#include <vector>
#include "test_macros.h"
-#define TEST_HAS_NO_INT128 // Size cannot be larger than 64 bits
#include "type_algorithms.h"
#include "types.h"
diff --git a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
index c2f7fd14042a8..fea532743d5c4 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
@@ -106,7 +106,11 @@ void test() {
// Same as below, if there is no type larger than long, we can just use that.
static_assert(sizeof(Iter::difference_type) >= sizeof(long));
static_assert(std::is_signed_v<Iter::difference_type>);
+#ifndef TEST_HAS_NO_INT128
+ LIBCPP_STATIC_ASSERT(std::same_as<Iter::difference_type, __int128_t>);
+#else
LIBCPP_STATIC_ASSERT(std::same_as<Iter::difference_type, long long>);
+#endif
}
{
const std::ranges::iota_view<long long> io(0);
@@ -118,7 +122,11 @@ void test() {
// https://eel.is/c++draft/range.iota.view#1.3
static_assert(sizeof(Iter::difference_type) >= sizeof(long long));
static_assert(std::is_signed_v<Iter::difference_type>);
+#ifndef TEST_HAS_NO_INT128
+ LIBCPP_STATIC_ASSERT(std::same_as<Iter::difference_type, __int128_t>);
+#else
LIBCPP_STATIC_ASSERT(std::same_as<Iter::difference_type, long long>);
+#endif
}
{
const std::ranges::iota_view<Decrementable> io;
diff --git a/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp
index 0806edef1429b..9078d575d531c 100644
--- a/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp
@@ -14,8 +14,10 @@
//
// Additionally, the stored Allocator value is move constructed from m.get_allocator().
-#include <regex>
#include <cassert>
+#include <regex>
+#include <utility>
+
#include "test_macros.h"
#include "test_allocator.h"
diff --git a/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
index e9f174068473d..d5c1f4d9348b8 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
@@ -12,11 +12,12 @@
// ~basic_string() // implied noexcept; // constexpr since C++20
-#include <string>
#include <cassert>
+#include <string>
+#include <type_traits>
-#include "test_macros.h"
#include "test_allocator.h"
+#include "test_macros.h"
template <class T>
struct throwing_alloc {
diff --git a/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp
index d9176da63d0dc..d47c9dfded226 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp
@@ -25,6 +25,7 @@
#include <iterator>
#include <string>
#include <type_traits>
+#include <utility>
#include "test_macros.h"
#include "test_allocator.h"
diff --git a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
index 3a6f84f2699ac..a19564b98b283 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
@@ -19,17 +19,18 @@
// The deduction guide shall not participate in overload resolution if Allocator
// is a type that does not qualify as an allocator.
-#include <string>
-#include <string_view>
+#include <cassert>
+#include <cstddef>
#include <iterator>
#include <memory>
+#include <string>
+#include <string_view>
#include <type_traits>
-#include <cassert>
-#include <cstddef>
+#include <utility>
-#include "test_macros.h"
-#include "test_allocator.h"
#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
template <class StringView, class Allocator, class = void>
struct CanDeduce : std::false_type {};
diff --git a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
index 08e696b7a091b..e36503d92be18 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
@@ -25,15 +25,16 @@
// The deduction guide shall not participate in overload resolution if Allocator
// is a type that does not qualify as an allocator.
-#include <string>
-#include <string_view>
-#include <iterator>
#include <cassert>
#include <cstddef>
+#include <iterator>
+#include <string>
+#include <string_view>
+#include <utility>
-#include "test_macros.h"
-#include "test_allocator.h"
#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
template <class StringView, class Size, class Allocator, class = void>
struct CanDeduce : std::false_type {};
diff --git a/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.construction/uses_allocator_construction_args.pass.cpp b/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.construction/uses_allocator_construction_args.pass.cpp
index 93a445d7c9e06..3cca2cc692200 100644
--- a/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.construction/uses_allocator_construction_args.pass.cpp
+++ b/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.construction/uses_allocator_construction_args.pass.cpp
@@ -18,6 +18,7 @@
#include <memory>
#include <ranges>
#include <tuple>
+#include <type_traits>
#include <utility>
#include "common.h"
diff --git a/libcxx/test/support/module.modulemap b/libcxx/test/support/module.modulemap
new file mode 100644
index 0000000000000..75ae8c4221ae0
--- /dev/null
+++ b/libcxx/test/support/module.modulemap
@@ -0,0 +1,10 @@
+
+module test_config {
+ module test_macros { textual header "test_macros.h" }
+}
+
+module test {
+ module double_move_tracker { header "double_move_tracker.h" }
+ module test_allocator { header "test_allocator.h" }
+ module type_algorithms { header "type_algorithms.h" }
+}
More information about the libcxx-commits
mailing list