[libcxx-commits] [libcxx] 3cd4531 - [libc++] Granularize <iterator> includes

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 10 13:44:03 PDT 2022


Author: Nikolas Klauser
Date: 2022-06-10T22:43:57+02:00
New Revision: 3cd4531b9ba421d1d096e746d787fe3039a546bb

URL: https://github.com/llvm/llvm-project/commit/3cd4531b9ba421d1d096e746d787fe3039a546bb
DIFF: https://github.com/llvm/llvm-project/commit/3cd4531b9ba421d1d096e746d787fe3039a546bb.diff

LOG: [libc++] Granularize <iterator> includes

Reviewed By: ldionne, #libc

Spies: libcxx-commits, wenlei

Differential Revision: https://reviews.llvm.org/D127445

Added: 
    

Modified: 
    libcxx/include/__algorithm/equal_range.h
    libcxx/include/__algorithm/inplace_merge.h
    libcxx/include/__algorithm/lower_bound.h
    libcxx/include/__algorithm/partition_point.h
    libcxx/include/__algorithm/ranges_count.h
    libcxx/include/__algorithm/ranges_count_if.h
    libcxx/include/__algorithm/ranges_for_each_n.h
    libcxx/include/__algorithm/rotate.h
    libcxx/include/__algorithm/sample.h
    libcxx/include/__algorithm/sort.h
    libcxx/include/__algorithm/stable_partition.h
    libcxx/include/__algorithm/unwrap_iter.h
    libcxx/include/__algorithm/upper_bound.h
    libcxx/include/__format/format_arg_store.h
    libcxx/include/__format/formatter.h
    libcxx/include/__hash_table
    libcxx/include/__memory/raw_storage_iterator.h
    libcxx/include/__tree
    libcxx/include/algorithm
    libcxx/include/any
    libcxx/include/array
    libcxx/include/deque
    libcxx/include/ext/hash_map
    libcxx/include/ext/hash_set
    libcxx/include/format
    libcxx/include/forward_list
    libcxx/include/istream
    libcxx/include/list
    libcxx/include/locale
    libcxx/include/map
    libcxx/include/memory
    libcxx/include/numeric
    libcxx/include/ostream
    libcxx/include/regex
    libcxx/include/set
    libcxx/include/span
    libcxx/include/string
    libcxx/include/string_view
    libcxx/include/unordered_map
    libcxx/include/unordered_set
    libcxx/include/vector
    libcxx/src/include/to_chars_floating_point.h
    libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp
    libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp
    libcxx/test/libcxx/fuzzing/fuzz.h
    libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
    libcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/deduct_const.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.cons/deduct_const.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/set/insert_iter_rv.pass.cpp
    libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/map_allocator_requirement_test_templates.h
    libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
    libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/erase_iter.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
    libcxx/test/std/containers/set_allocator_requirement_test_templates.h
    libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.map/bucket_count.pass.cpp
    libcxx/test/std/containers/unord/unord.map/bucket_size.pass.cpp
    libcxx/test/std/containers/unord/unord.map/count.pass.cpp
    libcxx/test/std/containers/unord/unord.map/eq.pass.cpp
    libcxx/test/std/containers/unord/unord.map/equal_range_const.pass.cpp
    libcxx/test/std/containers/unord/unord.map/equal_range_non_const.pass.cpp
    libcxx/test/std/containers/unord/unord.map/find_const.pass.cpp
    libcxx/test/std/containers/unord/unord.map/find_non_const.pass.cpp
    libcxx/test/std/containers/unord/unord.map/load_factor.pass.cpp
    libcxx/test/std/containers/unord/unord.map/swap_member.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct_const.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/count.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/eq.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/equal_range_const.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/equal_range_non_const.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/find_const.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/find_non_const.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/load_factor.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/swap_member.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
    libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
    libcxx/test/std/containers/views/views.span/span.cons/deduct.pass.cpp
    libcxx/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp
    libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/array.pass.cpp
    libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
    libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/int.pass.cpp
    libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/vector.pass.cpp
    libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.deref/deref.pass.cpp
    libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.incr/post.pass.cpp
    libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
    libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
    libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
    libcxx/test/std/utilities/format/format.functions/format_tests.h
    libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
    libcxx/test/std/utilities/memory/storage.iterator/types.compile.pass.cpp
    libcxx/test/support/archetypes.h
    libcxx/test/support/deduction_guides_sfinae_checks.h
    libcxx/test/support/min_allocator.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__algorithm/equal_range.h b/libcxx/include/__algorithm/equal_range.h
index e332fa80b9166..3e17772091ce5 100644
--- a/libcxx/include/__algorithm/equal_range.h
+++ b/libcxx/include/__algorithm/equal_range.h
@@ -16,7 +16,10 @@
 #include <__algorithm/upper_bound.h>
 #include <__config>
 #include <__functional/identity.h>
-#include <iterator>
+#include <__iterator/advance.h>
+#include <__iterator/distance.h>
+#include <__iterator/iterator_traits.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__algorithm/inplace_merge.h b/libcxx/include/__algorithm/inplace_merge.h
index 83f8c2f9054cd..ffc160cbe44b9 100644
--- a/libcxx/include/__algorithm/inplace_merge.h
+++ b/libcxx/include/__algorithm/inplace_merge.h
@@ -17,7 +17,10 @@
 #include <__algorithm/rotate.h>
 #include <__algorithm/upper_bound.h>
 #include <__config>
+#include <__iterator/advance.h>
+#include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
+#include <__iterator/reverse_iterator.h>
 #include <__utility/swap.h>
 #include <memory>
 

diff  --git a/libcxx/include/__algorithm/lower_bound.h b/libcxx/include/__algorithm/lower_bound.h
index 61625bef0f9b2..0334733f76c56 100644
--- a/libcxx/include/__algorithm/lower_bound.h
+++ b/libcxx/include/__algorithm/lower_bound.h
@@ -13,8 +13,12 @@
 #include <__algorithm/half_positive.h>
 #include <__config>
 #include <__functional/identity.h>
+#include <__functional/invoke.h>
+#include <__iterator/advance.h>
+#include <__iterator/distance.h>
+#include <__iterator/iterator_traits.h>
 #include <__type_traits/is_callable.h>
-#include <iterator>
+#include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__algorithm/partition_point.h b/libcxx/include/__algorithm/partition_point.h
index c2fa841edc6d0..1675534e60d5a 100644
--- a/libcxx/include/__algorithm/partition_point.h
+++ b/libcxx/include/__algorithm/partition_point.h
@@ -11,7 +11,9 @@
 
 #include <__algorithm/half_positive.h>
 #include <__config>
-#include <iterator>
+#include <__iterator/advance.h>
+#include <__iterator/distance.h>
+#include <__iterator/iterator_traits.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__algorithm/ranges_count.h b/libcxx/include/__algorithm/ranges_count.h
index 3cbcdc959d27c..670df26911d0c 100644
--- a/libcxx/include/__algorithm/ranges_count.h
+++ b/libcxx/include/__algorithm/ranges_count.h
@@ -15,6 +15,7 @@
 #include <__functional/ranges_operations.h>
 #include <__iterator/concepts.h>
 #include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
 #include <__iterator/projected.h>
 #include <__ranges/access.h>
 #include <__ranges/concepts.h>

diff  --git a/libcxx/include/__algorithm/ranges_count_if.h b/libcxx/include/__algorithm/ranges_count_if.h
index 9080631f629f0..0f34ee9f2b1b5 100644
--- a/libcxx/include/__algorithm/ranges_count_if.h
+++ b/libcxx/include/__algorithm/ranges_count_if.h
@@ -15,6 +15,7 @@
 #include <__functional/ranges_operations.h>
 #include <__iterator/concepts.h>
 #include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
 #include <__iterator/projected.h>
 #include <__ranges/access.h>
 #include <__ranges/concepts.h>

diff  --git a/libcxx/include/__algorithm/ranges_for_each_n.h b/libcxx/include/__algorithm/ranges_for_each_n.h
index f40f849a00e8a..ddf8b047cdb2e 100644
--- a/libcxx/include/__algorithm/ranges_for_each_n.h
+++ b/libcxx/include/__algorithm/ranges_for_each_n.h
@@ -15,6 +15,7 @@
 #include <__functional/invoke.h>
 #include <__iterator/concepts.h>
 #include <__iterator/incrementable_traits.h>
+#include <__iterator/iterator_traits.h>
 #include <__iterator/projected.h>
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>

diff  --git a/libcxx/include/__algorithm/rotate.h b/libcxx/include/__algorithm/rotate.h
index ec7b999c5b1a1..c9ea5bad4c5ad 100644
--- a/libcxx/include/__algorithm/rotate.h
+++ b/libcxx/include/__algorithm/rotate.h
@@ -18,7 +18,7 @@
 #include <__iterator/prev.h>
 #include <__utility/move.h>
 #include <__utility/swap.h>
-#include <iterator>
+#include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__algorithm/sample.h b/libcxx/include/__algorithm/sample.h
index 523496108217a..e04466a08d5a9 100644
--- a/libcxx/include/__algorithm/sample.h
+++ b/libcxx/include/__algorithm/sample.h
@@ -12,8 +12,10 @@
 #include <__algorithm/min.h>
 #include <__assert>
 #include <__config>
+#include <__iterator/distance.h>
+#include <__iterator/iterator_traits.h>
 #include <__random/uniform_int_distribution.h>
-#include <iterator>
+#include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h
index c69df948ecbb3..0f463e14cc498 100644
--- a/libcxx/include/__algorithm/sort.h
+++ b/libcxx/include/__algorithm/sort.h
@@ -18,6 +18,7 @@
 #include <__config>
 #include <__debug>
 #include <__functional/operations.h>
+#include <__iterator/iterator_traits.h>
 #include <__utility/swap.h>
 #include <climits>
 #include <memory>

diff  --git a/libcxx/include/__algorithm/stable_partition.h b/libcxx/include/__algorithm/stable_partition.h
index 1233cc157fb5e..a0f13606912ca 100644
--- a/libcxx/include/__algorithm/stable_partition.h
+++ b/libcxx/include/__algorithm/stable_partition.h
@@ -11,6 +11,8 @@
 
 #include <__algorithm/rotate.h>
 #include <__config>
+#include <__iterator/advance.h>
+#include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
 #include <__utility/swap.h>
 #include <memory>

diff  --git a/libcxx/include/__algorithm/unwrap_iter.h b/libcxx/include/__algorithm/unwrap_iter.h
index 7261ff44a0f20..be33194164cd8 100644
--- a/libcxx/include/__algorithm/unwrap_iter.h
+++ b/libcxx/include/__algorithm/unwrap_iter.h
@@ -10,8 +10,8 @@
 #define _LIBCPP___ALGORITHM_UNWRAP_ITER_H
 
 #include <__config>
+#include <__iterator/iterator_traits.h>
 #include <__memory/pointer_traits.h>
-#include <iterator>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

diff  --git a/libcxx/include/__algorithm/upper_bound.h b/libcxx/include/__algorithm/upper_bound.h
index cfa021e142479..c6483607e3c6e 100644
--- a/libcxx/include/__algorithm/upper_bound.h
+++ b/libcxx/include/__algorithm/upper_bound.h
@@ -12,7 +12,9 @@
 #include <__algorithm/comp.h>
 #include <__algorithm/half_positive.h>
 #include <__config>
-#include <iterator>
+#include <__iterator/advance.h>
+#include <__iterator/distance.h>
+#include <__iterator/iterator_traits.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__format/format_arg_store.h b/libcxx/include/__format/format_arg_store.h
index 28c9c28d96671..6602dfeb956b2 100644
--- a/libcxx/include/__format/format_arg_store.h
+++ b/libcxx/include/__format/format_arg_store.h
@@ -14,6 +14,8 @@
 #  pragma GCC system_header
 #endif
 
+#include <__concepts/arithmetic.h>
+#include <__concepts/same_as.h>
 #include <__config>
 #include <__format/concepts.h>
 #include <__format/format_arg.h>

diff  --git a/libcxx/include/__format/formatter.h b/libcxx/include/__format/formatter.h
index d7370b0bca023..c39e25b354ebc 100644
--- a/libcxx/include/__format/formatter.h
+++ b/libcxx/include/__format/formatter.h
@@ -15,6 +15,7 @@
 #include <__algorithm/transform.h>
 #include <__assert>
 #include <__availability>
+#include <__concepts/same_as.h>
 #include <__config>
 #include <__format/format_error.h>
 #include <__format/format_fwd.h>

diff  --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index be28a035e75b4..20223014432fd 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -17,10 +17,10 @@
 #include <__config>
 #include <__debug>
 #include <__functional/hash.h>
+#include <__iterator/iterator_traits.h>
 #include <__utility/swap.h>
 #include <cmath>
 #include <initializer_list>
-#include <iterator>
 #include <memory>
 #include <type_traits>
 

diff  --git a/libcxx/include/__memory/raw_storage_iterator.h b/libcxx/include/__memory/raw_storage_iterator.h
index f25f7b1a728ad..9b6594b8883eb 100644
--- a/libcxx/include/__memory/raw_storage_iterator.h
+++ b/libcxx/include/__memory/raw_storage_iterator.h
@@ -11,10 +11,11 @@
 #define _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H
 
 #include <__config>
+#include <__iterator/iterator.h>
+#include <__iterator/iterator_traits.h>
 #include <__memory/addressof.h>
 #include <__utility/move.h>
 #include <cstddef>
-#include <iterator>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__tree b/libcxx/include/__tree
index c493ff9be03e1..4e6aee3b84caa 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -11,10 +11,14 @@
 #define _LIBCPP___TREE
 
 #include <__algorithm/min.h>
+#include <__assert>
 #include <__config>
+#include <__debug>
+#include <__iterator/distance.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
 #include <__utility/forward.h>
 #include <__utility/swap.h>
-#include <iterator>
 #include <limits>
 #include <memory>
 #include <stdexcept>

diff  --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index f3436b7e0c85d..0a9513ffb5580 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1068,7 +1068,7 @@ template <class BidirectionalIterator, class Compare>
 #include <cstddef>
 #include <cstring>
 #include <initializer_list>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <memory>
 #include <type_traits>
 #include <version>

diff  --git a/libcxx/include/any b/libcxx/include/any
index 308a49e810369..991d887bf29ae 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -88,6 +88,7 @@ namespace std {
 #include <__utility/move.h>
 #include <__utility/unreachable.h>
 #include <cstdlib>
+#include <initializer_list>
 #include <memory>
 #include <type_traits>
 #include <typeinfo>

diff  --git a/libcxx/include/array b/libcxx/include/array
index 786dc75746695..4258853853429 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -114,11 +114,13 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
 #include <__algorithm/swap_ranges.h>
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
+#include <__iterator/reverse_iterator.h>
 #include <__tuple>
 #include <__utility/integer_sequence.h>
 #include <__utility/move.h>
 #include <__utility/unreachable.h>
-#include <iterator>
+#include <compare>
+#include <iterator> // TODO: Remove this include
 #include <stdexcept>
 #include <type_traits>
 #include <version>

diff  --git a/libcxx/include/deque b/libcxx/include/deque
index d782963c18fec..559de77f070d0 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -173,13 +173,16 @@ template <class T, class Allocator, class Predicate>
 #include <__config>
 #include <__format/enable_insertable.h>
 #include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <__iterator/prev.h>
+#include <__iterator/reverse_iterator.h>
 #include <__split_buffer>
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <__utility/swap.h>
 #include <compare>
 #include <initializer_list>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <stdexcept>
 #include <type_traits>

diff  --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map
index 92572c08c24cc..eec8a8ad99928 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -207,6 +207,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
 #include <algorithm>
 #include <ext/__hash>
 #include <functional>
+#include <iterator> // TODO: Remove this include
 #include <stdexcept>
 #include <type_traits>
 

diff  --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set
index eb61939406682..4b68bec436808 100644
--- a/libcxx/include/ext/hash_set
+++ b/libcxx/include/ext/hash_set
@@ -198,6 +198,7 @@ template <class Value, class Hash, class Pred, class Alloc>
 #include <algorithm>
 #include <ext/__hash>
 #include <functional>
+#include <iterator> // TODO: Remove this include
 
 #if defined(__DEPRECATED) && __DEPRECATED
 #if defined(_LIBCPP_WARNING)

diff  --git a/libcxx/include/format b/libcxx/include/format
index 98fa0b0346b33..95d85127a1967 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -146,6 +146,7 @@ namespace std {
 #include <__format/formatter_pointer.h>
 #include <__format/formatter_string.h>
 #include <__format/parser_std_format_spec.h>
+#include <__iterator/incrementable_traits.h>
 #include <__variant/monostate.h>
 #include <array>
 #include <concepts>

diff  --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index 23c1229e7b5c7..3dd0308c22c65 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -184,9 +184,13 @@ template <class T, class Allocator, class Predicate>
 #include <__algorithm/min.h>
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
+#include <__iterator/distance.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/move_iterator.h>
+#include <__iterator/next.h>
 #include <__utility/forward.h>
 #include <initializer_list>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <memory>
 #include <type_traits>

diff  --git a/libcxx/include/istream b/libcxx/include/istream
index c082be1c1b929..7af5dfa474cdf 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -160,6 +160,7 @@ template <class Stream, class T>
 
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
+#include <__iterator/istreambuf_iterator.h>
 #include <__utility/forward.h>
 #include <ostream>
 #include <version>

diff  --git a/libcxx/include/list b/libcxx/include/list
index 45ccfec6f3362..2ad428a23c1d5 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -188,11 +188,17 @@ template <class T, class Allocator, class Predicate>
 #include <__config>
 #include <__debug>
 #include <__format/enable_insertable.h>
+#include <__iterator/distance.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/move_iterator.h>
+#include <__iterator/next.h>
+#include <__iterator/prev.h>
+#include <__iterator/reverse_iterator.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <__utility/swap.h>
 #include <initializer_list>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <memory>
 #include <type_traits>

diff  --git a/libcxx/include/locale b/libcxx/include/locale
index ecbb44a520a4d..9d58be4724776 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -196,6 +196,10 @@ template <class charT> class messages_byname;
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
 #include <__debug>
+#include <__iterator/access.h>
+#include <__iterator/back_insert_iterator.h>
+#include <__iterator/istreambuf_iterator.h>
+#include <__iterator/ostreambuf_iterator.h>
 #include <__locale>
 #ifndef __APPLE__
 # include <cstdarg>
@@ -204,7 +208,7 @@ template <class charT> class messages_byname;
 #include <cstdlib>
 #include <ctime>
 #include <ios>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <memory>
 #include <streambuf>

diff  --git a/libcxx/include/map b/libcxx/include/map
index d48f3a25646ed..33d83591ed824 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -535,14 +535,16 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <__functional/binary_function.h>
 #include <__functional/is_transparent.h>
 #include <__functional/operations.h>
+#include <__iterator/erase_if_container.h>
 #include <__iterator/iterator_traits.h>
+#include <__iterator/reverse_iterator.h>
 #include <__node_handle>
 #include <__tree>
 #include <__utility/forward.h>
 #include <__utility/swap.h>
 #include <compare>
 #include <initializer_list>
-#include <iterator> // __libcpp_erase_if_container
+#include <iterator> // TODO: Remove this include
 #include <memory>
 #include <type_traits>
 #include <version>

diff  --git a/libcxx/include/memory b/libcxx/include/memory
index 1360f9da8be89..f69fc4d67dda6 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -864,7 +864,7 @@ template<size_t N, class T>
 #include <cstdint>
 #include <cstring>
 #include <iosfwd>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <new>
 #include <stdexcept>
 #include <tuple>

diff  --git a/libcxx/include/numeric b/libcxx/include/numeric
index 0a5843f108380..4b142756e5df0 100644
--- a/libcxx/include/numeric
+++ b/libcxx/include/numeric
@@ -147,7 +147,7 @@ template<class T>
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
 #include <cmath> // for isnormal
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <version>
 
 #include <__numeric/accumulate.h>

diff  --git a/libcxx/include/ostream b/libcxx/include/ostream
index 17b0813ef9e5f..9679e42b318d1 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -138,7 +138,7 @@ template <class Stream, class T>
 #include <__config>
 #include <bitset>
 #include <ios>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <locale>
 #include <streambuf>
 #include <version>

diff  --git a/libcxx/include/regex b/libcxx/include/regex
index 5d078744c5d84..a6ad7d625a525 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -766,6 +766,8 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
 #include <__algorithm/search.h>
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
+#include <__iterator/access.h>
+#include <__iterator/back_insert_iterator.h>
 #include <__iterator/wrap_iter.h>
 #include <__locale>
 #include <__utility/move.h>
@@ -773,7 +775,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
 #include <compare>
 #include <deque>
 #include <initializer_list>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <memory>
 #include <stdexcept>
 #include <string>

diff  --git a/libcxx/include/set b/libcxx/include/set
index be7af622880de..fb29e4dbc4f8a 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -477,13 +477,15 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <__config>
 #include <__functional/is_transparent.h>
 #include <__functional/operations.h>
+#include <__iterator/erase_if_container.h>
 #include <__iterator/iterator_traits.h>
+#include <__iterator/reverse_iterator.h>
 #include <__node_handle>
 #include <__tree>
 #include <__utility/forward.h>
 #include <compare>
 #include <initializer_list>
-#include <iterator> // __libcpp_erase_if_container
+#include <iterator> // TODO: Remove this include
 #include <version>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

diff  --git a/libcxx/include/span b/libcxx/include/span
index 38b2ae1cb157b..41100c91edfba 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -132,7 +132,9 @@ template<class R>
 #include <__debug>
 #include <__fwd/span.h>
 #include <__iterator/concepts.h>
+#include <__iterator/iterator_traits.h>
 #include <__iterator/wrap_iter.h>
+#include <__memory/pointer_traits.h>
 #include <__ranges/concepts.h>
 #include <__ranges/data.h>
 #include <__ranges/enable_borrowed_range.h>
@@ -141,7 +143,7 @@ template<class R>
 #include <__utility/forward.h>
 #include <array>        // for array
 #include <cstddef>      // for byte
-#include <iterator>     // for iterators
+#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <type_traits>  // for remove_cv, etc
 #include <version>

diff  --git a/libcxx/include/string b/libcxx/include/string
index cb32392d44062..a5e1290441607 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -527,6 +527,9 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
 #include <__functional/hash.h>
 #include <__functional/unary_function.h>
 #include <__ios/fpos.h>
+#include <__iterator/distance.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/reverse_iterator.h>
 #include <__iterator/wrap_iter.h>
 #include <__memory/allocate_at_least.h>
 #include <__string/char_traits.h>
@@ -542,7 +545,7 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
 #include <cstring>
 #include <initializer_list>
 #include <iosfwd>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <memory>
 #include <stdexcept>

diff  --git a/libcxx/include/string_view b/libcxx/include/string_view
index 88df90a312976..9e60bae22b06e 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -202,6 +202,10 @@ namespace std {
 #include <__functional/hash.h>
 #include <__functional/unary_function.h>
 #include <__fwd/string_view.h>
+#include <__iterator/concepts.h>
+#include <__iterator/readable_traits.h>
+#include <__iterator/reverse_iterator.h>
+#include <__memory/pointer_traits.h>
 #include <__ranges/concepts.h>
 #include <__ranges/data.h>
 #include <__ranges/enable_borrowed_range.h>
@@ -210,7 +214,7 @@ namespace std {
 #include <__string/char_traits.h>
 #include <compare>
 #include <iosfwd>
-#include <iterator>
+#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <stdexcept>
 #include <type_traits>

diff  --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index c1cd7f48d1d60..4fc068d6e696b 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -521,12 +521,14 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
 #include <__functional/is_transparent.h>
 #include <__functional/operations.h>
 #include <__hash_table>
+#include <__iterator/distance.h>
+#include <__iterator/erase_if_container.h>
 #include <__iterator/iterator_traits.h>
 #include <__memory/addressof.h>
 #include <__node_handle>
 #include <__utility/forward.h>
 #include <compare>
-#include <iterator> // __libcpp_erase_if_container
+#include <iterator> // TODO: Remove this include
 #include <stdexcept>
 #include <tuple>
 #include <version>

diff  --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set
index a74116d1689d7..48c6ff48df30f 100644
--- a/libcxx/include/unordered_set
+++ b/libcxx/include/unordered_set
@@ -466,11 +466,14 @@ template <class Value, class Hash, class Pred, class Alloc>
 #include <__functional/is_transparent.h>
 #include <__functional/operations.h>
 #include <__hash_table>
+#include <__iterator/distance.h>
+#include <__iterator/erase_if_container.h>
+#include <__iterator/iterator_traits.h>
 #include <__memory/addressof.h>
 #include <__node_handle>
 #include <__utility/forward.h>
 #include <compare>
-#include <iterator> // __libcpp_erase_if_container
+#include <iterator> // TODO: Remove this include
 #include <version>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

diff  --git a/libcxx/include/vector b/libcxx/include/vector
index 19c634927de6d..f3710ea680597 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -286,7 +286,9 @@ erase_if(vector<T, Allocator>& c, Predicate pred);    // C++20
 #include <__format/enable_insertable.h>
 #include <__functional/hash.h>
 #include <__functional/unary_function.h>
+#include <__iterator/advance.h>
 #include <__iterator/iterator_traits.h>
+#include <__iterator/reverse_iterator.h>
 #include <__iterator/wrap_iter.h>
 #include <__memory/allocate_at_least.h>
 #include <__split_buffer>

diff  --git a/libcxx/src/include/to_chars_floating_point.h b/libcxx/src/include/to_chars_floating_point.h
index 0bb45d0b97910..b99d790f65c79 100644
--- a/libcxx/src/include/to_chars_floating_point.h
+++ b/libcxx/src/include/to_chars_floating_point.h
@@ -23,6 +23,7 @@
 #include <__algorithm/min.h>
 #include <__assert>
 #include <__config>
+#include <__functional/operations.h>
 #include <__iterator/access.h>
 #include <__iterator/size.h>
 #include <bit>

diff  --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp
index 11bf72973b02c..d12a238a7d328 100644
--- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp
@@ -18,6 +18,7 @@
 
 #include <algorithm>
 #include <cassert>
+#include <iterator>
 #include <type_traits>
 
 struct S {

diff  --git a/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp b/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp
index e2c78defb3ceb..1ae42dad42dfe 100644
--- a/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp
@@ -12,6 +12,7 @@
 // template<class S, class I>
 // concept __nothrow_sentinel_for;
 
+#include <iterator>
 #include <memory>
 
 static_assert(std::ranges::__nothrow_sentinel_for<int*, int*>);

diff  --git a/libcxx/test/libcxx/fuzzing/fuzz.h b/libcxx/test/libcxx/fuzzing/fuzz.h
index 1281879c536c5..5e70d0afdb468 100644
--- a/libcxx/test/libcxx/fuzzing/fuzz.h
+++ b/libcxx/test/libcxx/fuzzing/fuzz.h
@@ -13,6 +13,7 @@
 #include <cstddef>
 #include <cstdint>
 #include <cstring> // std::strlen
+#include <iterator>
 #include <type_traits>
 #include <utility> // std::swap
 

diff  --git a/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp b/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
index d0495df4b415a..ea9b10ed473ed 100644
--- a/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
+++ b/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
@@ -15,6 +15,7 @@
 
 #include <numeric>
 #include <cassert>
+#include <cstdint>
 #include "test_macros.h"
 
 //  Users are not supposed to provide template argument lists for

diff  --git a/libcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp b/libcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp
index 144d39c47b84e..d457baf4d5fdf 100644
--- a/libcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp
+++ b/libcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp
@@ -11,6 +11,7 @@
 #include <algorithm>
 #include <cstddef>
 #include <functional>
+#include <iterator>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/containers/associative/map/map.cons/deduct_const.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/deduct_const.pass.cpp
index 3da55fa69759a..5b36d1e27f744 100644
--- a/libcxx/test/std/containers/associative/map/map.cons/deduct_const.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.cons/deduct_const.pass.cpp
@@ -29,6 +29,7 @@
 #include <cassert>
 #include <climits> // INT_MAX
 #include <functional>
+#include <iterator>
 #include <map>
 #include <type_traits>
 

diff  --git a/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
index 55711676c8dfa..bcfafe86449c3 100644
--- a/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
@@ -16,6 +16,7 @@
 
 #include <map>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "MoveOnly.h"

diff  --git a/libcxx/test/std/containers/associative/multimap/multimap.cons/deduct_const.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/deduct_const.pass.cpp
index 716c5221dfb92..c8f25dcd19964 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.cons/deduct_const.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.cons/deduct_const.pass.cpp
@@ -29,6 +29,7 @@
 #include <cassert>
 #include <climits> // INT_MAX
 #include <functional>
+#include <iterator>
 #include <map>
 #include <type_traits>
 

diff  --git a/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
index 620caaef19325..d279dba40a197 100644
--- a/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
@@ -16,6 +16,7 @@
 
 #include <set>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "MoveOnly.h"

diff  --git a/libcxx/test/std/containers/associative/set/insert_iter_rv.pass.cpp b/libcxx/test/std/containers/associative/set/insert_iter_rv.pass.cpp
index ce490ac17c139..5ce5182b868f9 100644
--- a/libcxx/test/std/containers/associative/set/insert_iter_rv.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/insert_iter_rv.pass.cpp
@@ -16,6 +16,7 @@
 
 #include <set>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "MoveOnly.h"

diff  --git a/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
index 2d9916c4f376d..59d536ef5c7a0 100644
--- a/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
@@ -16,6 +16,7 @@
 
 #include <set>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "MoveOnly.h"

diff  --git a/libcxx/test/std/containers/map_allocator_requirement_test_templates.h b/libcxx/test/std/containers/map_allocator_requirement_test_templates.h
index 65d57737733fb..de14d3f43439d 100644
--- a/libcxx/test/std/containers/map_allocator_requirement_test_templates.h
+++ b/libcxx/test/std/containers/map_allocator_requirement_test_templates.h
@@ -21,6 +21,7 @@
 // UNSUPPORTED: c++03
 
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "count_new.h"

diff  --git a/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp b/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
index ed2d814d37fed..b0f9c3a7815e0 100644
--- a/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
@@ -13,6 +13,7 @@
 #include <array>
 #include <cassert>
 #include <cstddef>       // for std::max_align_t
+#include <cstdint>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp b/libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
index d9336e3fef374..f6c2e594cc991 100644
--- a/libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
@@ -13,6 +13,7 @@
 #include <array>
 #include <cassert>
 #include <cstddef>       // for std::max_align_t
+#include <cstdint>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp
index 92427f8a48e2b..55ce87cfe174c 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp
@@ -12,6 +12,7 @@
 
 #include <forward_list>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "../../../NotConstructible.h"

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp
index 23fd26ff5c28d..51476559b60ab 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp
@@ -12,6 +12,7 @@
 
 #include <forward_list>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp
index 06e1d8d8b91a1..ce035955862b8 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp
@@ -12,6 +12,7 @@
 
 #include <forward_list>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp
index 64a6431e43d45..606440ca21e6c 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp
@@ -12,6 +12,7 @@
 
 #include <forward_list>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "DefaultOnly.h"

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp
index 33e9c2833dfa7..3c0b64e85a1bf 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp
@@ -12,6 +12,7 @@
 
 #include <forward_list>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "DefaultOnly.h"

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
index ba225b40a999b..6b16d66fedb2e 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
@@ -13,6 +13,7 @@
 
 #include <forward_list>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "test_allocator.h"

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
index 3edc8bc4e5850..e46a55cf81e4f 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
@@ -14,6 +14,7 @@
 
 #include <forward_list>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "test_allocator.h"

diff  --git a/libcxx/test/std/containers/sequences/vector.bool/erase_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/erase_iter.pass.cpp
index 483d2ac280a2f..53a3eac6550a9 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/erase_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/erase_iter.pass.cpp
@@ -13,6 +13,7 @@
 
 #include <vector>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp
index 5461d75b1fe92..c2c6e561e82b7 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp
@@ -13,6 +13,7 @@
 
 #include <vector>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
index e2cf53ec6bd3a..cda5ba8acfe75 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
@@ -19,6 +19,7 @@
 
 #include <vector>
 #include <cassert>
+#include <iterator>
 #include <type_traits>
 
 #include "test_macros.h"

diff  --git a/libcxx/test/std/containers/set_allocator_requirement_test_templates.h b/libcxx/test/std/containers/set_allocator_requirement_test_templates.h
index 78b0c826d4ec9..68b77a258d7b8 100644
--- a/libcxx/test/std/containers/set_allocator_requirement_test_templates.h
+++ b/libcxx/test/std/containers/set_allocator_requirement_test_templates.h
@@ -20,6 +20,7 @@
 
 
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "count_new.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp b/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
index 93c177a7df45b..0f2e7216b61eb 100644
--- a/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/bucket_count.pass.cpp b/libcxx/test/std/containers/unord/unord.map/bucket_count.pass.cpp
index ee1a125232b51..6283408cef6f0 100644
--- a/libcxx/test/std/containers/unord/unord.map/bucket_count.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/bucket_count.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/bucket_size.pass.cpp b/libcxx/test/std/containers/unord/unord.map/bucket_size.pass.cpp
index 31adf31e93065..110ac5e45eec1 100644
--- a/libcxx/test/std/containers/unord/unord.map/bucket_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/bucket_size.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/count.pass.cpp b/libcxx/test/std/containers/unord/unord.map/count.pass.cpp
index fc83dc4f9258e..a003208ab0256 100644
--- a/libcxx/test/std/containers/unord/unord.map/count.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/count.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/eq.pass.cpp b/libcxx/test/std/containers/unord/unord.map/eq.pass.cpp
index bcb6cb78adac4..5b4dfe3f2bb4a 100644
--- a/libcxx/test/std/containers/unord/unord.map/eq.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/eq.pass.cpp
@@ -21,6 +21,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/equal_range_const.pass.cpp b/libcxx/test/std/containers/unord/unord.map/equal_range_const.pass.cpp
index 3519fb531a1ee..eb8beaec3db14 100644
--- a/libcxx/test/std/containers/unord/unord.map/equal_range_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/equal_range_const.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/equal_range_non_const.pass.cpp b/libcxx/test/std/containers/unord/unord.map/equal_range_non_const.pass.cpp
index 47dc892de37e2..f0e268edfc716 100644
--- a/libcxx/test/std/containers/unord/unord.map/equal_range_non_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/equal_range_non_const.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/find_const.pass.cpp b/libcxx/test/std/containers/unord/unord.map/find_const.pass.cpp
index 7da7a9c321b64..fa8417b72becd 100644
--- a/libcxx/test/std/containers/unord/unord.map/find_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/find_const.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/find_non_const.pass.cpp b/libcxx/test/std/containers/unord/unord.map/find_non_const.pass.cpp
index e242a7d2a8d04..00c5605c2b491 100644
--- a/libcxx/test/std/containers/unord/unord.map/find_non_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/find_non_const.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/load_factor.pass.cpp b/libcxx/test/std/containers/unord/unord.map/load_factor.pass.cpp
index 7a5fde8a48954..6bb7f89f3a13e 100644
--- a/libcxx/test/std/containers/unord/unord.map/load_factor.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/load_factor.pass.cpp
@@ -19,6 +19,7 @@
 #include <cassert>
 #include <cmath>
 #include <cfloat>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/swap_member.pass.cpp b/libcxx/test/std/containers/unord/unord.map/swap_member.pass.cpp
index 2053e58237a53..955aa31a88ae3 100644
--- a/libcxx/test/std/containers/unord/unord.map/swap_member.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/swap_member.pass.cpp
@@ -18,6 +18,7 @@
 #include <string>
 #include <cassert>
 #include <cstddef>
+#include <iterator>
 
 #include "../../test_compare.h"
 #include "../../test_hash.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.pass.cpp
index d543e38c2ec90..9a36348c684d5 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.pass.cpp
@@ -58,6 +58,7 @@
 #include <algorithm> // is_permutation
 #include <cassert>
 #include <climits> // INT_MAX
+#include <iterator>
 #include <type_traits>
 #include <unordered_map>
 

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct_const.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct_const.pass.cpp
index 506a2b7edd3e2..547eef02961f8 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct_const.pass.cpp
@@ -58,6 +58,7 @@
 #include <algorithm> // std::is_permutation
 #include <cassert>
 #include <climits> // INT_MAX
+#include <iterator>
 #include <type_traits>
 #include <unordered_map>
 

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.pass.cpp
index 63346e1b6a6f5..f6baeec9ff1c4 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
index 4b42db807fd09..e1c893f3daf51 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
@@ -14,7 +14,9 @@
 
 // node_type extract(key_type const&);
 
+#include <iterator>
 #include <unordered_map>
+
 #include "test_macros.h"
 #include "min_allocator.h"
 #include "Counter.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
index 6d7e945e827e6..1b7c9e00da470 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
@@ -23,6 +23,7 @@
 
 #include <unordered_map>
 #include <cassert>
+#include <iterator>
 #include <tuple>
 
 #include "test_macros.h"

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
index 945d972107f2a..bf2c317f712eb 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
@@ -23,6 +23,7 @@
 
 #include <unordered_map>
 #include <cassert>
+#include <iterator>
 #include <tuple>
 
 #include "test_macros.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
index 981cb332caff7..80c97ddc99cee 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
index 9c07357190944..3515dbc93ca45 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp
index 7e0a9474eeb5f..1659fef9d462c 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/count.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/count.pass.cpp
index d3a82bed259a6..4ece256652955 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/count.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/count.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/eq.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/eq.pass.cpp
index 1ebf1206d9a87..9b7ee304783a9 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/eq.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/eq.pass.cpp
@@ -21,6 +21,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/equal_range_const.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/equal_range_const.pass.cpp
index e936b96296a35..c827ae5009a67 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/equal_range_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/equal_range_const.pass.cpp
@@ -18,6 +18,7 @@
 #include <string>
 #include <set>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/equal_range_non_const.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/equal_range_non_const.pass.cpp
index 7549103e82563..6cfa586d5a17e 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/equal_range_non_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/equal_range_non_const.pass.cpp
@@ -18,6 +18,7 @@
 #include <string>
 #include <set>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/find_const.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/find_const.pass.cpp
index b35bed3c5644e..d9ccd868896c7 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/find_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/find_const.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/find_non_const.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/find_non_const.pass.cpp
index 2b823723dd7f7..5f9b60fdfdc84 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/find_non_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/find_non_const.pass.cpp
@@ -17,6 +17,7 @@
 #include <unordered_map>
 #include <string>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/load_factor.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/load_factor.pass.cpp
index 4e848ef50f919..81284edab8d49 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/load_factor.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/load_factor.pass.cpp
@@ -19,6 +19,7 @@
 #include <cassert>
 #include <cfloat>
 #include <cmath>
+#include <iterator>
 
 #include "test_macros.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/swap_member.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/swap_member.pass.cpp
index 25f19f9e37a82..257938b0628f1 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/swap_member.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/swap_member.pass.cpp
@@ -19,6 +19,7 @@
 #include <set>
 #include <cassert>
 #include <cstddef>
+#include <iterator>
 
 #include "test_macros.h"
 #include "../../test_compare.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp
index c22f12161c125..5a98a013a0933 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp
@@ -59,6 +59,7 @@
 #include <cassert>
 #include <climits> // INT_MAX
 #include <functional>
+#include <iterator>
 #include <type_traits>
 #include <unordered_map>
 

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
index 9dcb0a4a2b102..2a6e3f60ca6b5 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
@@ -20,6 +20,7 @@
 
 #include <unordered_map>
 #include <cassert>
+#include <iterator>
 
 #include "../../../Emplaceable.h"
 #include "min_allocator.h"

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
index 692aa9862fbe2..8aafbdd46b12b 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
@@ -19,6 +19,7 @@
 #include <set>
 #include <cassert>
 #include <cstddef>
+#include <iterator>
 
 #include "test_macros.h"
 #include "../../../check_consecutive.h"

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp b/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
index 0228386cc8abd..7481987862ed5 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
@@ -13,6 +13,7 @@
 
 #include <span>
 #include <cassert>
+#include <iterator>
 #include <string>
 #include <utility>
 

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/deduct.pass.cpp b/libcxx/test/std/containers/views/views.span/span.cons/deduct.pass.cpp
index e632feca2e1f1..398862dccdb6a 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/deduct.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/deduct.pass.cpp
@@ -28,6 +28,7 @@
 #include <span>
 #include <array>
 #include <cassert>
+#include <iterator>
 #include <memory>
 #include <string>
 

diff  --git a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp
index cf14ac65cd6ce..9332158f0de95 100644
--- a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp
@@ -14,6 +14,7 @@
 
 #include <regex>
 #include <cassert>
+#include <iterator>
 #include "test_macros.h"
 
 int main(int, char**)

diff  --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/array.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/array.pass.cpp
index 254909a92e03d..ed1d5ee963389 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/array.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/array.pass.cpp
@@ -19,6 +19,8 @@
 
 #include <regex>
 #include <cassert>
+#include <iterator>
+
 #include "test_macros.h"
 
 int main(int, char**)

diff  --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
index 018dca29dd019..a5087817223c5 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
@@ -20,6 +20,8 @@
 
 #include <regex>
 #include <cassert>
+#include <iterator>
+
 #include "test_macros.h"
 
 int main(int, char**)

diff  --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/int.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/int.pass.cpp
index 1e5ba2eca12a0..2abed8e827cd9 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/int.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/int.pass.cpp
@@ -17,6 +17,8 @@
 
 #include <regex>
 #include <cassert>
+#include <iterator>
+
 #include "test_macros.h"
 
 int main(int, char**)

diff  --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/vector.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/vector.pass.cpp
index 1d77deb918583..b2ef0b23e528e 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/vector.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/vector.pass.cpp
@@ -18,6 +18,8 @@
 
 #include <regex>
 #include <cassert>
+#include <iterator>
+
 #include "test_macros.h"
 
 int main(int, char**)

diff  --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.deref/deref.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.deref/deref.pass.cpp
index facd243675b0c..1785df2abe181 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.deref/deref.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.deref/deref.pass.cpp
@@ -14,6 +14,8 @@
 
 #include <regex>
 #include <cassert>
+#include <iterator>
+
 #include "test_macros.h"
 
 int main(int, char**)

diff  --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.incr/post.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.incr/post.pass.cpp
index 15f1bb7c85167..8d44f3a5ae66c 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.incr/post.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.incr/post.pass.cpp
@@ -14,6 +14,8 @@
 
 #include <regex>
 #include <cassert>
+#include <iterator>
+
 #include "test_macros.h"
 
 int main(int, char**)

diff  --git a/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
index 715c8b732cecf..1c8540ad15fe7 100644
--- a/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
@@ -14,6 +14,7 @@
 
 #include <string_view>
 #include <cassert>
+#include <iterator>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp b/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
index ae6390c69e072..fcc5b7f0bfadc 100644
--- a/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
@@ -18,6 +18,7 @@
 
 #include <string_view>
 #include <cassert>
+#include <iterator>
 #include <limits>
 
 #include "test_macros.h"

diff  --git a/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp b/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
index ed2bc16a4d455..8652a2d10fcb8 100644
--- a/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
@@ -11,6 +11,7 @@
 #include <cmath>
 #include <fstream>
 #include <functional>
+#include <iterator>
 #include <limits>
 #include <locale>
 #include <optional>

diff  --git a/libcxx/test/std/utilities/format/format.functions/format_tests.h b/libcxx/test/std/utilities/format/format.functions/format_tests.h
index 4ee580bb2a942..d8ba8c5960d01 100644
--- a/libcxx/test/std/utilities/format/format.functions/format_tests.h
+++ b/libcxx/test/std/utilities/format/format.functions/format_tests.h
@@ -11,9 +11,11 @@
 #include <format>
 
 #include <algorithm>
+#include <cassert>
 #include <charconv>
 #include <cmath>
 #include <cstdint>
+#include <iterator>
 
 #include "make_string.h"
 #include "string_literal.h"

diff  --git a/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp b/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
index 2af85f78d47d3..f33dbff7e2f11 100644
--- a/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
+++ b/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
@@ -15,6 +15,7 @@
 //   allocate_at_least(Allocator& a, size_t n);
 
 #include <cassert>
+#include <concepts>
 #include <memory>
 
 // check that std::allocation_result exists and isn't restricted to pointers

diff  --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
index a12c1222eddae..6ac63a49d5015 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
@@ -13,6 +13,7 @@
 // allocation_result<T*> allocate_at_least(size_t n)
 
 #include <cassert>
+#include <concepts>
 #include <memory>
 
 #include "count_new.h"

diff  --git a/libcxx/test/std/utilities/memory/storage.iterator/types.compile.pass.cpp b/libcxx/test/std/utilities/memory/storage.iterator/types.compile.pass.cpp
index 0772124091134..d11ab1a64b80e 100644
--- a/libcxx/test/std/utilities/memory/storage.iterator/types.compile.pass.cpp
+++ b/libcxx/test/std/utilities/memory/storage.iterator/types.compile.pass.cpp
@@ -12,6 +12,7 @@
 // raw_storage_iterator associated types
 
 #include <cstddef>
+#include <iterator>
 #include <memory>
 #include <type_traits>
 

diff  --git a/libcxx/test/support/archetypes.h b/libcxx/test/support/archetypes.h
index 073f395829109..53545f687970e 100644
--- a/libcxx/test/support/archetypes.h
+++ b/libcxx/test/support/archetypes.h
@@ -11,6 +11,7 @@
 
 #include <type_traits>
 #include <cassert>
+#include <initializer_list>
 
 #include "test_macros.h"
 #include "test_workarounds.h"

diff  --git a/libcxx/test/support/deduction_guides_sfinae_checks.h b/libcxx/test/support/deduction_guides_sfinae_checks.h
index a4910a1e8ad63..767ff0242e1fe 100644
--- a/libcxx/test/support/deduction_guides_sfinae_checks.h
+++ b/libcxx/test/support/deduction_guides_sfinae_checks.h
@@ -11,6 +11,7 @@
 
 #include <functional>
 #include <initializer_list>
+#include <iterator>
 #include <memory>
 #include <type_traits>
 #include <utility>

diff  --git a/libcxx/test/support/min_allocator.h b/libcxx/test/support/min_allocator.h
index 0cf050eb96dcc..a216974f98ce3 100644
--- a/libcxx/test/support/min_allocator.h
+++ b/libcxx/test/support/min_allocator.h
@@ -14,6 +14,7 @@
 #include <cstddef>
 #include <cassert>
 #include <climits>
+#include <iterator>
 #include <memory>
 
 #include "test_macros.h"


        


More information about the libcxx-commits mailing list