[libcxx-commits] [libcxx] 430b397 - [libc++] Granularize <type_traits> includes in <iterator>
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Dec 26 17:32:23 PST 2022
Author: Nikolas Klauser
Date: 2022-12-27T02:32:16+01:00
New Revision: 430b397f6715d4d2f2569716c93fcd6292ace3dc
URL: https://github.com/llvm/llvm-project/commit/430b397f6715d4d2f2569716c93fcd6292ace3dc
DIFF: https://github.com/llvm/llvm-project/commit/430b397f6715d4d2f2569716c93fcd6292ace3dc.diff
LOG: [libc++] Granularize <type_traits> includes in <iterator>
Reviewed By: Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D140621
Added:
Modified:
libcxx/include/__algorithm/shuffle.h
libcxx/include/__algorithm/sort.h
libcxx/include/__debug
libcxx/include/__iterator/bounded_iter.h
libcxx/include/__iterator/common_iterator.h
libcxx/include/__iterator/counted_iterator.h
libcxx/include/__iterator/move_iterator.h
libcxx/include/__iterator/projected.h
libcxx/include/__iterator/size.h
libcxx/include/__iterator/wrap_iter.h
libcxx/include/__memory/uses_allocator_construction.h
libcxx/include/__tree
libcxx/include/experimental/iterator
libcxx/include/fstream
libcxx/include/iterator
libcxx/include/locale
libcxx/include/module.modulemap.in
libcxx/include/scoped_allocator
libcxx/include/tuple
libcxx/include/variant
libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/cpp20_iter_concepts.pass.cpp
libcxx/test/libcxx/transitive_includes/cxx2b.csv
libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/indirectly_readable.compile.pass.cpp
libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/iter_common_reference_t.compile.pass.cpp
libcxx/test/std/iterators/predef.iterators/iterators.common/ctor.converting.pass.cpp
libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/assign.converting.pass.cpp
libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.converting.pass.cpp
libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.sentinel.pass.cpp
libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp
libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp
libcxx/test/support/min_allocator.h
Removed:
################################################################################
diff --git a/libcxx/include/__algorithm/shuffle.h b/libcxx/include/__algorithm/shuffle.h
index c2f5c37efa8d1..f7bce68697b5d 100644
--- a/libcxx/include/__algorithm/shuffle.h
+++ b/libcxx/include/__algorithm/shuffle.h
@@ -16,6 +16,7 @@
#include <__random/uniform_int_distribution.h>
#include <__utility/forward.h>
#include <__utility/move.h>
+#include <__utility/swap.h>
#include <cstddef>
#include <cstdint>
diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h
index 5cb496d2e678e..76786baf02ad8 100644
--- a/libcxx/include/__algorithm/sort.h
+++ b/libcxx/include/__algorithm/sort.h
@@ -26,9 +26,12 @@
#include <__iterator/iterator_traits.h>
#include <__memory/destruct_n.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_arithmetic.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <climits>
+#include <cstdint>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__debug b/libcxx/include/__debug
index ae0c1a5af06ee..140cc9142a82b 100644
--- a/libcxx/include/__debug
+++ b/libcxx/include/__debug
@@ -12,8 +12,8 @@
#include <__assert>
#include <__config>
+#include <__type_traits/is_constant_evaluated.h>
#include <cstddef>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__iterator/bounded_iter.h b/libcxx/include/__iterator/bounded_iter.h
index 64cdadb02cdad..69d237a180109 100644
--- a/libcxx/include/__iterator/bounded_iter.h
+++ b/libcxx/include/__iterator/bounded_iter.h
@@ -14,8 +14,9 @@
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__memory/pointer_traits.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_convertible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__iterator/common_iterator.h b/libcxx/include/__iterator/common_iterator.h
index d0947bbd07f35..e45f602373044 100644
--- a/libcxx/include/__iterator/common_iterator.h
+++ b/libcxx/include/__iterator/common_iterator.h
@@ -25,6 +25,8 @@
#include <__iterator/iter_swap.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/readable_traits.h>
+#include <__type_traits/is_pointer.h>
+#include <__utility/declval.h>
#include <variant>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/libcxx/include/__iterator/counted_iterator.h b/libcxx/include/__iterator/counted_iterator.h
index 5edd9c9422c50..5fdbff4b4866e 100644
--- a/libcxx/include/__iterator/counted_iterator.h
+++ b/libcxx/include/__iterator/counted_iterator.h
@@ -25,9 +25,10 @@
#include <__iterator/iterator_traits.h>
#include <__iterator/readable_traits.h>
#include <__memory/pointer_traits.h>
+#include <__type_traits/add_pointer.h>
+#include <__type_traits/conditional.h>
#include <__utility/move.h>
#include <compare>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__iterator/move_iterator.h b/libcxx/include/__iterator/move_iterator.h
index b4f2f9ec3d5ca..6475f722778d3 100644
--- a/libcxx/include/__iterator/move_iterator.h
+++ b/libcxx/include/__iterator/move_iterator.h
@@ -24,8 +24,12 @@
#include <__iterator/iterator_traits.h>
#include <__iterator/move_sentinel.h>
#include <__iterator/readable_traits.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_assignable.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_same.h>
+#include <__utility/declval.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__iterator/projected.h b/libcxx/include/__iterator/projected.h
index 3a08b58b8bfb4..19c076b2e560b 100644
--- a/libcxx/include/__iterator/projected.h
+++ b/libcxx/include/__iterator/projected.h
@@ -13,7 +13,7 @@
#include <__config>
#include <__iterator/concepts.h>
#include <__iterator/incrementable_traits.h>
-#include <type_traits>
+#include <__type_traits/remove_cvref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__iterator/size.h b/libcxx/include/__iterator/size.h
index e06013496668e..1452bd1d55cd8 100644
--- a/libcxx/include/__iterator/size.h
+++ b/libcxx/include/__iterator/size.h
@@ -11,8 +11,9 @@
#define _LIBCPP___ITERATOR_SIZE_H
#include <__config>
+#include <__type_traits/common_type.h>
+#include <__type_traits/make_signed.h>
#include <cstddef>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__iterator/wrap_iter.h b/libcxx/include/__iterator/wrap_iter.h
index 80be74ef58f81..16defc1d8b021 100644
--- a/libcxx/include/__iterator/wrap_iter.h
+++ b/libcxx/include/__iterator/wrap_iter.h
@@ -15,7 +15,8 @@
#include <__iterator/iterator_traits.h>
#include <__memory/addressof.h>
#include <__memory/pointer_traits.h>
-#include <type_traits>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_convertible.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__memory/uses_allocator_construction.h b/libcxx/include/__memory/uses_allocator_construction.h
index 02e0668d1233d..0f63b080daf3b 100644
--- a/libcxx/include/__memory/uses_allocator_construction.h
+++ b/libcxx/include/__memory/uses_allocator_construction.h
@@ -14,6 +14,8 @@
#include <__memory/uses_allocator.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/is_same.h>
+#include <__type_traits/remove_cv.h>
+#include <__utility/declval.h>
#include <__utility/pair.h>
#include <tuple>
diff --git a/libcxx/include/__tree b/libcxx/include/__tree
index 05a3da158098c..f5d9d595b4b2d 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -14,6 +14,7 @@
#include <__assert>
#include <__config>
#include <__debug>
+#include <__functional/invoke.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
@@ -23,6 +24,17 @@
#include <__memory/swap_allocator.h>
#include <__memory/unique_ptr.h>
#include <__type_traits/can_extract_key.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/is_nothrow_copy_constructible.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_swappable.h>
+#include <__type_traits/remove_const_ref.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
diff --git a/libcxx/include/experimental/iterator b/libcxx/include/experimental/iterator
index 399365ed0c744..cf73b74e887e0 100644
--- a/libcxx/include/experimental/iterator
+++ b/libcxx/include/experimental/iterator
@@ -54,6 +54,7 @@ namespace std {
#include <__assert> // all public C++ headers provide the assertion handler
#include <__memory/addressof.h>
+#include <__type_traits/decay.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <experimental/__config>
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index 0c09f21913ec2..41e95bf3dc669 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -1757,6 +1757,7 @@ _LIBCPP_POP_MACROS
# include <limits>
# include <new>
# include <stdexcept>
+# include <type_traits>
#endif
#endif // _LIBCPP_FSTREAM
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index 679b3da317242..35eca67b4a5e8 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -719,7 +719,6 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#include <__memory/pointer_traits.h>
#include <cstddef>
#include <initializer_list>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -735,6 +734,7 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <exception>
# include <new>
+# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
diff --git a/libcxx/include/locale b/libcxx/include/locale
index 31804552844f2..f322a1183f021 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -4369,6 +4369,7 @@ _LIBCPP_POP_MACROS
# include <cstdarg>
# include <iterator>
# include <stdexcept>
+# include <type_traits>
# include <typeinfo>
#endif
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index bff3f7e48dae8..5a69bea5b3a6b 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -892,7 +892,10 @@ module std [system] {
module hash { private header "__functional/hash.h" }
module hash_fwd { private header "__fwd/hash.h" }
module identity { private header "__functional/identity.h" }
- module invoke { private header "__functional/invoke.h" }
+ module invoke {
+ private header "__functional/invoke.h"
+ export type_traits
+ }
module is_transparent { private header "__functional/is_transparent.h" }
module mem_fn { private header "__functional/mem_fn.h" }
module mem_fun_ref { private header "__functional/mem_fun_ref.h" }
@@ -1408,7 +1411,10 @@ module std [system] {
module is_convertible { private header "__type_traits/is_convertible.h" }
module is_copy_assignable { private header "__type_traits/is_copy_assignable.h" }
module is_copy_constructible { private header "__type_traits/is_copy_constructible.h" }
- module is_core_convertible { private header "__type_traits/is_core_convertible.h" }
+ module is_core_convertible {
+ private header "__type_traits/is_core_convertible.h"
+ export integral_constant
+ }
module is_default_constructible { private header "__type_traits/is_default_constructible.h" }
module is_destructible { private header "__type_traits/is_destructible.h" }
module is_empty { private header "__type_traits/is_empty.h" }
@@ -1469,7 +1475,10 @@ module std [system] {
module is_unsigned { private header "__type_traits/is_unsigned.h" }
module is_unsigned_integer { private header "__type_traits/is_unsigned_integer.h" }
module is_valid_expansion { private header "__type_traits/is_valid_expansion.h" }
- module is_void { private header "__type_traits/is_void.h" }
+ module is_void {
+ private header "__type_traits/is_void.h"
+ export integral_constant
+ }
module is_volatile { private header "__type_traits/is_volatile.h" }
module lazy { private header "__type_traits/lazy.h" }
module make_32_64_or_128_bit { private header "__type_traits/make_32_64_or_128_bit.h" }
diff --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator
index 56cb9ee40cdba..88e56c2b09e7c 100644
--- a/libcxx/include/scoped_allocator
+++ b/libcxx/include/scoped_allocator
@@ -118,6 +118,7 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
#include <__type_traits/integral_constant.h>
#include <__type_traits/is_constructible.h>
#include <__type_traits/remove_reference.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index 7149875be4bef..b75d00c4e431b 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -205,11 +205,45 @@ template <class... Types>
#include <__compare/common_comparison_category.h>
#include <__compare/synth_three_way.h>
#include <__config>
+#include <__functional/invoke.h>
#include <__functional/unwrap_ref.h>
#include <__fwd/array.h>
#include <__memory/allocator_arg_t.h>
#include <__memory/uses_allocator.h>
+#include <__type_traits/apply_cv.h>
+#include <__type_traits/common_reference.h>
+#include <__type_traits/common_type.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/copy_cvref.h>
+#include <__type_traits/disjunction.h>
+#include <__type_traits/is_arithmetic.h>
+#include <__type_traits/is_assignable.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_default_constructible.h>
+#include <__type_traits/is_empty.h>
+#include <__type_traits/is_final.h>
+#include <__type_traits/is_implicitly_default_constructible.h>
+#include <__type_traits/is_move_assignable.h>
+#include <__type_traits/is_move_constructible.h>
+#include <__type_traits/is_nothrow_assignable.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_copy_assignable.h>
+#include <__type_traits/is_nothrow_copy_constructible.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_swappable.h>
+#include <__type_traits/lazy.h>
#include <__type_traits/maybe_const.h>
+#include <__type_traits/nat.h>
+#include <__type_traits/negation.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/integer_sequence.h>
#include <__utility/move.h>
@@ -217,7 +251,6 @@ template <class... Types>
#include <__utility/piecewise_construct.h>
#include <__utility/swap.h>
#include <cstddef>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -1822,6 +1855,7 @@ _LIBCPP_END_NAMESPACE_STD
# include <exception>
# include <iosfwd>
# include <new>
+# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 001b86f746605..2379b226b157e 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -211,9 +211,26 @@ namespace std {
#include <__compare/three_way_comparable.h>
#include <__config>
#include <__functional/hash.h>
+#include <__functional/invoke.h>
#include <__functional/operations.h>
#include <__functional/unary_function.h>
+#include <__type_traits/add_const.h>
+#include <__type_traits/add_cv.h>
+#include <__type_traits/add_pointer.h>
+#include <__type_traits/add_volatile.h>
#include <__type_traits/dependent_type.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_destructible.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_trivially_copy_assignable.h>
+#include <__type_traits/is_trivially_copy_constructible.h>
+#include <__type_traits/is_trivially_destructible.h>
+#include <__type_traits/is_trivially_move_assignable.h>
+#include <__type_traits/is_trivially_move_constructible.h>
+#include <__type_traits/is_void.h>
+#include <__type_traits/remove_const.h>
+#include <__type_traits/type_identity.h>
+#include <__type_traits/void_t.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
@@ -224,7 +241,6 @@ namespace std {
#include <limits>
#include <new>
#include <tuple>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -1815,6 +1831,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
diff --git a/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/cpp20_iter_concepts.pass.cpp b/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/cpp20_iter_concepts.pass.cpp
index 17ac69b65561f..5eddf794d0c14 100644
--- a/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/cpp20_iter_concepts.pass.cpp
+++ b/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/cpp20_iter_concepts.pass.cpp
@@ -19,9 +19,13 @@
// random_access_iterator_tag.
// (1.4) -- Otherwise, ITER_CONCEPT(I) does not denote a type.
+// ADDITIONAL_COMPILE_FLAGS: -Wno-private-header
+
#include "test_macros.h"
+#include <__type_traits/is_valid_expansion.h>
#include <iterator>
+
struct OtherTag : std::input_iterator_tag {};
struct OtherTagTwo : std::output_iterator_tag {};
diff --git a/libcxx/test/libcxx/transitive_includes/cxx2b.csv b/libcxx/test/libcxx/transitive_includes/cxx2b.csv
index 61706cd1e4c16..b20017730a99e 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx2b.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx2b.csv
@@ -305,7 +305,6 @@ fstream istream
fstream mutex
fstream ostream
fstream string
-fstream type_traits
fstream typeinfo
fstream version
functional array
@@ -367,7 +366,6 @@ iterator cstdlib
iterator initializer_list
iterator iosfwd
iterator limits
-iterator type_traits
iterator variant
iterator version
latch atomic
@@ -401,7 +399,6 @@ locale mutex
locale new
locale streambuf
locale string
-locale type_traits
locale version
map compare
map cstddef
@@ -655,7 +652,6 @@ thread type_traits
thread version
tuple compare
tuple cstddef
-tuple type_traits
tuple version
type_traits cstddef
type_traits cstdint
@@ -721,7 +717,6 @@ variant initializer_list
variant limits
variant new
variant tuple
-variant type_traits
variant version
vector climits
vector compare
diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/indirectly_readable.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/indirectly_readable.compile.pass.cpp
index d42014b2430df..e06234477e290 100644
--- a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/indirectly_readable.compile.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/indirectly_readable.compile.pass.cpp
@@ -11,9 +11,9 @@
// template<class In>
// concept indirectly_readable;
-#include <iterator>
-
#include <concepts>
+#include <iterator>
+#include <type_traits>
#include "read_write.h"
diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/iter_common_reference_t.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/iter_common_reference_t.compile.pass.cpp
index a173caddd4b23..e6302e3dfdcc5 100644
--- a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/iter_common_reference_t.compile.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/iter_common_reference_t.compile.pass.cpp
@@ -10,9 +10,9 @@
// iter_common_reference_t
-#include <iterator>
-
#include <concepts>
+#include <iterator>
+#include <type_traits>
struct X { };
diff --git a/libcxx/test/std/iterators/predef.iterators/iterators.common/ctor.converting.pass.cpp b/libcxx/test/std/iterators/predef.iterators/iterators.common/ctor.converting.pass.cpp
index 97c9d40febcec..741654ea640ca 100644
--- a/libcxx/test/std/iterators/predef.iterators/iterators.common/ctor.converting.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/iterators.common/ctor.converting.pass.cpp
@@ -12,10 +12,9 @@
// requires convertible_to<const I2&, I> && convertible_to<const S2&, S>
// constexpr common_iterator(const common_iterator<I2, S2>& x);
-#include <iterator>
#include <cassert>
-
-#include "test_macros.h"
+#include <iterator>
+#include <type_traits>
constexpr bool test()
{
diff --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/assign.converting.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/assign.converting.pass.cpp
index 57f9ad70b7ada..aa81390e1ec0c 100644
--- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/assign.converting.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/assign.converting.pass.cpp
@@ -16,9 +16,10 @@
// requires assignable_from<S&, const S2&>
// constexpr move_sentinel& operator=(const move_sentinel<S2>& s);
-#include <iterator>
#include <cassert>
#include <concepts>
+#include <iterator>
+#include <type_traits>
struct NonAssignable {
NonAssignable& operator=(int i);
diff --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.converting.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.converting.pass.cpp
index 5f5be0c7f1591..21271b191fdc4 100644
--- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.converting.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.converting.pass.cpp
@@ -16,9 +16,10 @@
// requires convertible_to<const S2&, S>
// constexpr move_sentinel(const move_sentinel<S2>& s);
-#include <iterator>
#include <cassert>
#include <concepts>
+#include <iterator>
+#include <type_traits>
struct NonConvertible {
explicit NonConvertible();
diff --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.sentinel.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.sentinel.pass.cpp
index 1fc2843f465aa..425b3bdfd19cc 100644
--- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.sentinel.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.sentinel.pass.cpp
@@ -14,8 +14,9 @@
// constexpr explicit move_sentinel(S s);
-#include <iterator>
#include <cassert>
+#include <iterator>
+#include <type_traits>
constexpr bool test()
{
diff --git a/libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp b/libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp
index d9a6706b3b68b..158ea46ff2c06 100644
--- a/libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp
+++ b/libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp
@@ -21,6 +21,7 @@ TEST_MSVC_DIAGNOSTIC_IGNORED(4242 4244) // Various truncation warnings
#include <compare>
#include <limits> // quiet_NaN
#include <tuple>
+#include <type_traits>
#include <utility> // declval
template <typename T, typename U = T>
diff --git a/libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp
index ef819e2031e3d..769c55e10fc43 100644
--- a/libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp
@@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
-#include <tuple>
#include <cassert>
+#include <tuple>
+#include <type_traits>
#include "test_macros.h"
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp
index 648f8bfaffb1d..a2d1170da8262 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp
@@ -17,9 +17,10 @@
//
// See https://llvm.org/PR22806.
-#include <tuple>
-#include <memory>
#include <cassert>
+#include <memory>
+#include <tuple>
+#include <type_traits>
#include "test_macros.h"
diff --git a/libcxx/test/support/min_allocator.h b/libcxx/test/support/min_allocator.h
index 529c29115f2de..f27ac80c04649 100644
--- a/libcxx/test/support/min_allocator.h
+++ b/libcxx/test/support/min_allocator.h
@@ -9,14 +9,14 @@
#ifndef MIN_ALLOCATOR_H
#define MIN_ALLOCATOR_H
-#include <cstddef>
-#include <cstdlib>
-#include <cstddef>
#include <cassert>
#include <climits>
+#include <cstddef>
+#include <cstdlib>
#include <iterator>
#include <memory>
#include <new>
+#include <type_traits>
#include "test_macros.h"
More information about the libcxx-commits
mailing list