aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcxx/include/algorithm18
-rw-r--r--libcxx/include/any8
-rw-r--r--libcxx/include/array12
-rw-r--r--libcxx/include/atomic18
-rw-r--r--libcxx/include/bit8
-rw-r--r--libcxx/include/charconv8
-rw-r--r--libcxx/include/coroutine8
-rw-r--r--libcxx/include/deque12
-rw-r--r--libcxx/include/experimental/simd10
-rw-r--r--libcxx/include/experimental/unordered_map16
-rw-r--r--libcxx/include/ext/hash_map8
-rw-r--r--libcxx/include/ext/hash_set8
-rw-r--r--libcxx/include/forward_list12
-rw-r--r--libcxx/include/functional8
-rw-r--r--libcxx/include/future8
-rw-r--r--libcxx/include/iterator8
-rw-r--r--libcxx/include/list12
-rw-r--r--libcxx/include/locale8
-rw-r--r--libcxx/include/map12
-rw-r--r--libcxx/include/memory10
-rw-r--r--libcxx/include/mutex8
-rw-r--r--libcxx/include/numeric10
-rw-r--r--libcxx/include/optional36
-rw-r--r--libcxx/include/ostream8
-rw-r--r--libcxx/include/queue8
-rw-r--r--libcxx/include/random8
-rw-r--r--libcxx/include/regex10
-rw-r--r--libcxx/include/set10
-rw-r--r--libcxx/include/span10
-rw-r--r--libcxx/include/stack8
-rw-r--r--libcxx/include/string20
-rw-r--r--libcxx/include/string_view12
-rw-r--r--libcxx/include/thread16
-rw-r--r--libcxx/include/tuple16
-rw-r--r--libcxx/include/typeindex12
-rw-r--r--libcxx/include/unordered_map12
-rw-r--r--libcxx/include/unordered_set10
-rw-r--r--libcxx/include/utility8
-rw-r--r--libcxx/include/valarray10
-rw-r--r--libcxx/include/variant10
-rw-r--r--libcxx/include/vector12
41 files changed, 233 insertions, 233 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 0b54fb9..f036fd0 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1899,15 +1899,6 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/unwrap_iter.h>
#include <__algorithm/upper_bound.h>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
-# include <chrono> // IGNORE-CYCLE due to <format>
-#endif
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iterator>
-# include <utility>
-#endif
-
// standard-mandated includes
#include <initializer_list>
@@ -1919,4 +1910,13 @@ template <class BidirectionalIterator, class Compare>
# include <__pstl_algorithm>
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
+# include <chrono> // IGNORE-CYCLE due to <format>
+#endif
+
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iterator>
+# include <utility>
+#endif
+
#endif // _LIBCPP_ALGORITHM
diff --git a/libcxx/include/any b/libcxx/include/any
index a70c6f11..ec12cfa 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -94,10 +94,6 @@ namespace std {
#include <typeinfo>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
-# include <chrono> // IGNORE-CYCLE due to <format>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -695,4 +691,8 @@ any_cast(any * __any) _NOEXCEPT
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
+# include <chrono> // IGNORE-CYCLE due to <format>
+#endif
+
#endif // _LIBCPP_ANY
diff --git a/libcxx/include/array b/libcxx/include/array
index 415ac16..4b91569 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -123,12 +123,6 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <iterator>
-# include <utility>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -535,4 +529,10 @@ to_array(_Tp(&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <iterator>
+# include <utility>
+#endif
+
#endif // _LIBCPP_ARRAY
diff --git a/libcxx/include/atomic b/libcxx/include/atomic
index 2e92088..571e34b 100644
--- a/libcxx/include/atomic
+++ b/libcxx/include/atomic
@@ -534,15 +534,6 @@ template <class T>
# include <__threading_support>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
-# include <chrono> // IGNORE-CYCLE due to <format>
-#endif
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <cmath>
-# include <compare>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -2707,4 +2698,13 @@ typedef atomic<__libcpp_unsigned_lock_free> atomic_unsigned_lock_free;
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
+# include <chrono> // IGNORE-CYCLE due to <format>
+#endif
+
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cmath>
+# include <compare>
+#endif
+
#endif // _LIBCPP_ATOMIC
diff --git a/libcxx/include/bit b/libcxx/include/bit
index 1505c9b..e3fb6e3 100644
--- a/libcxx/include/bit
+++ b/libcxx/include/bit
@@ -71,10 +71,6 @@ namespace std {
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iosfwd>
-#endif
-
#if defined(_LIBCPP_COMPILER_MSVC)
# include <intrin.h>
#endif
@@ -256,4 +252,8 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iosfwd>
+#endif
+
#endif // _LIBCPP_BIT
diff --git a/libcxx/include/charconv b/libcxx/include/charconv
index d77cf3a..6d6a7db 100644
--- a/libcxx/include/charconv
+++ b/libcxx/include/charconv
@@ -97,10 +97,6 @@ namespace std {
#include <limits>
#include <type_traits>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iosfwd>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -824,4 +820,8 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iosfwd>
+#endif
+
#endif // _LIBCPP_CHARCONV
diff --git a/libcxx/include/coroutine b/libcxx/include/coroutine
index d7ed44e..a81d68f 100644
--- a/libcxx/include/coroutine
+++ b/libcxx/include/coroutine
@@ -46,10 +46,6 @@ struct suspend_always;
#include <__coroutine/trivial_awaitables.h>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iosfwd>
-#endif
-
// standard-mandated includes
#include <compare>
@@ -57,4 +53,8 @@ struct suspend_always;
# pragma GCC system_header
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iosfwd>
+#endif
+
#endif // _LIBCPP_COROUTINE
diff --git a/libcxx/include/deque b/libcxx/include/deque
index c38b544..9a26f16 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -185,12 +185,6 @@ template <class T, class Allocator, class Predicate>
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <functional>
-# include <iterator>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -2932,4 +2926,10 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <functional>
+# include <iterator>
+#endif
+
#endif // _LIBCPP_DEQUE
diff --git a/libcxx/include/experimental/simd b/libcxx/include/experimental/simd
index 532bc64..4a52358 100644
--- a/libcxx/include/experimental/simd
+++ b/libcxx/include/experimental/simd
@@ -656,11 +656,6 @@ public:
#include <experimental/__config>
#include <tuple>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <functional>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -1581,4 +1576,9 @@ _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <functional>
+#endif
+
#endif /* _LIBCPP_EXPERIMENTAL_SIMD */
diff --git a/libcxx/include/experimental/unordered_map b/libcxx/include/experimental/unordered_map
index db114dc..d280182 100644
--- a/libcxx/include/experimental/unordered_map
+++ b/libcxx/include/experimental/unordered_map
@@ -45,14 +45,6 @@ namespace pmr {
#include <experimental/memory_resource>
#include <unordered_map>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <array>
-# include <bit>
-# include <functional>
-# include <vector>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -75,4 +67,12 @@ using unordered_multimap = _VSTD::unordered_multimap<_Key, _Value, _Hash, _Pred,
_LIBCPP_END_NAMESPACE_LFTS_PMR
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <array>
+# include <bit>
+# include <functional>
+# include <vector>
+#endif
+
#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_MAP */
diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map
index ab5a896..b7830e8 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -210,10 +210,6 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <stdexcept>
#include <type_traits>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iterator>
-#endif
-
#if defined(__DEPRECATED) && __DEPRECATED
#if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>")
@@ -987,4 +983,8 @@ operator!=(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
} // namespace __gnu_cxx
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iterator>
+#endif
+
#endif // _LIBCPP_HASH_MAP
diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set
index 332d609..68b449d 100644
--- a/libcxx/include/ext/hash_set
+++ b/libcxx/include/ext/hash_set
@@ -199,10 +199,6 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <ext/__hash>
#include <functional>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iterator>
-#endif
-
#if defined(__DEPRECATED) && __DEPRECATED
#if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>")
@@ -666,4 +662,8 @@ operator!=(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
} // namespace __gnu_cxx
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iterator>
+#endif
+
#endif // _LIBCPP_HASH_SET
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index c9fc20b..d5ea3ec 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -195,12 +195,6 @@ template <class T, class Allocator, class Predicate>
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <functional>
-# include <iterator>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -1788,4 +1782,10 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <functional>
+# include <iterator>
+#endif
+
#endif // _LIBCPP_FORWARD_LIST
diff --git a/libcxx/include/functional b/libcxx/include/functional
index c969d7f..60f6514 100644
--- a/libcxx/include/functional
+++ b/libcxx/include/functional
@@ -539,12 +539,12 @@ POLICY: For non-variadic implementations, the number of arguments is limited
#include <typeinfo>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <utility>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <utility>
+#endif
+
#endif // _LIBCPP_FUNCTIONAL
diff --git a/libcxx/include/future b/libcxx/include/future
index 643600a..716daa7 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -378,10 +378,6 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
#include <thread>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
-# include <chrono> // IGNORE-CYCLE due to <format>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -2436,4 +2432,8 @@ future<void>::share() _NOEXCEPT
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
+# include <chrono> // IGNORE-CYCLE due to <format>
+#endif
+
#endif // _LIBCPP_FUTURE
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index 6555b6d..be544b8 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -724,6 +724,10 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#include <type_traits>
#include <version>
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <exception>
# include <new>
@@ -731,8 +735,4 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
# include <utility>
#endif
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
#endif // _LIBCPP_ITERATOR
diff --git a/libcxx/include/list b/libcxx/include/list
index 668875b..a4e6def 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -203,12 +203,6 @@ template <class T, class Allocator, class Predicate>
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <functional>
-# include <iterator>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -2364,4 +2358,10 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <functional>
+# include <iterator>
+#endif
+
#endif // _LIBCPP_LIST
diff --git a/libcxx/include/locale b/libcxx/include/locale
index c7da783..3fe8f5d 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -211,10 +211,6 @@ template <class charT> class messages_byname;
#include <streambuf>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iterator>
-#endif
-
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
// Most unix variants have catopen. These are the specific ones that don't.
# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)
@@ -4356,4 +4352,8 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iterator>
+#endif
+
#endif // _LIBCPP_LOCALE
diff --git a/libcxx/include/map b/libcxx/include/map
index 1e619b9..20e6126 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -546,12 +546,6 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <functional>
-# include <iterator>
-# include <utility>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -2335,4 +2329,10 @@ inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <functional>
+# include <iterator>
+# include <utility>
+#endif
+
#endif // _LIBCPP_MAP
diff --git a/libcxx/include/memory b/libcxx/include/memory
index 47134a0..0da19ee 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -887,11 +887,6 @@ template<size_t N, class T>
#include <typeinfo>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iterator>
-# include <utility>
-#endif
-
// standard-mandated includes
#include <compare>
@@ -1044,4 +1039,9 @@ _LIBCPP_END_NAMESPACE_STD
# include <__pstl_memory>
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iterator>
+# include <utility>
+#endif
+
#endif // _LIBCPP_MEMORY
diff --git a/libcxx/include/mutex b/libcxx/include/mutex
index a8334ba3..3aea375 100644
--- a/libcxx/include/mutex
+++ b/libcxx/include/mutex
@@ -198,10 +198,6 @@ template<class Callable, class ...Args>
#endif
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <functional>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -706,4 +702,8 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <functional>
+#endif
+
#endif // _LIBCPP_MUTEX
diff --git a/libcxx/include/numeric b/libcxx/include/numeric
index ba030aa..64cd45b 100644
--- a/libcxx/include/numeric
+++ b/libcxx/include/numeric
@@ -163,11 +163,6 @@ template<class T>
#include <__numeric/transform_inclusive_scan.h>
#include <__numeric/transform_reduce.h>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <functional>
-# include <iterator>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -176,4 +171,9 @@ template<class T>
# include <__pstl_numeric>
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <functional>
+# include <iterator>
+#endif
+
#endif // _LIBCPP_NUMERIC
diff --git a/libcxx/include/optional b/libcxx/include/optional
index d75b1fe..38412af 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -177,24 +177,6 @@ template<class T>
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
-# include <chrono> // IGNORE-CYCLE due to <format>
-#endif
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <atomic>
-# include <climits>
-# include <concepts>
-# include <ctime>
-# include <iterator>
-# include <memory>
-# include <ratio>
-# include <tuple>
-# include <typeinfo>
-# include <utility>
-# include <variant>
-#endif
-
// standard-mandated includes
#include <compare>
@@ -1590,4 +1572,22 @@ _LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER > 14
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
+# include <chrono> // IGNORE-CYCLE due to <format>
+#endif
+
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
+# include <climits>
+# include <concepts>
+# include <ctime>
+# include <iterator>
+# include <memory>
+# include <ratio>
+# include <tuple>
+# include <typeinfo>
+# include <utility>
+# include <variant>
+#endif
+
#endif // _LIBCPP_OPTIONAL
diff --git a/libcxx/include/ostream b/libcxx/include/ostream
index 216e583..19fe7b0 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -171,10 +171,6 @@ basic_ostream<wchar_t, traits>& operator<<(basic_ostream<wchar_t, traits>&, cons
#include <streambuf>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iterator>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -1189,4 +1185,8 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iterator>
+#endif
+
#endif // _LIBCPP_OSTREAM
diff --git a/libcxx/include/queue b/libcxx/include/queue
index 9a5cfb3..5e4b6ba 100644
--- a/libcxx/include/queue
+++ b/libcxx/include/queue
@@ -231,10 +231,6 @@ template <class T, class Container, class Compare>
#include <vector>
#include <version>
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
-# include <functional>
-#endif
-
// standard-mandated includes
#include <compare>
#include <initializer_list>
@@ -960,4 +956,8 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<priority_queue<_Tp, _Container, _Comp
_LIBCPP_END_NAMESPACE_STD
+#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+# include <functional>
+#endif
+
#endif // _LIBCPP_QUEUE
diff --git a/libcxx/include/random b/libcxx/include/random
index 1193d0d..cc246f9 100644
--- a/libcxx/include/random
+++ b/libcxx/include/random
@@ -1718,10 +1718,6 @@ class piecewise_linear_distribution
#include <__random/weibull_distribution.h>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-#endif
-
// standard-mandated includes
#include <initializer_list>
@@ -1739,4 +1735,8 @@ class piecewise_linear_distribution
# pragma GCC system_header
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+#endif
+
#endif // _LIBCPP_RANDOM
diff --git a/libcxx/include/regex b/libcxx/include/regex
index 3899892..95a211f 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -778,11 +778,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#include <vector>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iterator>
-# include <utility>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -6844,4 +6839,9 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iterator>
+# include <utility>
+#endif
+
#endif // _LIBCPP_REGEX
diff --git a/libcxx/include/set b/libcxx/include/set
index f97ae2a..e251857 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -485,11 +485,6 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
#include <__utility/forward.h>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <functional>
-# include <iterator>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -1578,4 +1573,9 @@ inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <functional>
+# include <iterator>
+#endif
+
#endif // _LIBCPP_SET
diff --git a/libcxx/include/span b/libcxx/include/span
index 42fbd91..337a674 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -148,11 +148,6 @@ template<class R>
#include <type_traits> // for remove_cv, etc
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <functional>
-# include <iterator>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -594,4 +589,9 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <functional>
+# include <iterator>
+#endif
+
#endif // _LIBCPP_SPAN
diff --git a/libcxx/include/stack b/libcxx/include/stack
index a4a76e5..8f0a997 100644
--- a/libcxx/include/stack
+++ b/libcxx/include/stack
@@ -107,10 +107,6 @@ template <class T, class Container>
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <functional>
-#endif
-
// standard-mandated includes
#include <compare>
#include <initializer_list>
@@ -363,4 +359,8 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<stack<_Tp, _Container>, _Alloc>
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <functional>
+#endif
+
#endif // _LIBCPP_STACK
diff --git a/libcxx/include/string b/libcxx/include/string
index 6010177..26e55ce 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -569,16 +569,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
# include <cwchar>
#endif
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <functional>
-# include <iterator>
-# include <new>
-# include <typeinfo>
-# include <utility>
-# include <vector>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -4765,4 +4755,14 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <functional>
+# include <iterator>
+# include <new>
+# include <typeinfo>
+# include <utility>
+# include <vector>
+#endif
+
#endif // _LIBCPP_STRING
diff --git a/libcxx/include/string_view b/libcxx/include/string_view
index 1e1abc7..c3df8c4 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -224,12 +224,6 @@ namespace std {
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <functional>
-# include <iterator>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -1034,4 +1028,10 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <functional>
+# include <iterator>
+#endif
+
#endif // _LIBCPP_STRING_VIEW
diff --git a/libcxx/include/thread b/libcxx/include/thread
index 85a845c..85e9275 100644
--- a/libcxx/include/thread
+++ b/libcxx/include/thread
@@ -99,14 +99,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
-# include <chrono> // IGNORE-CYCLE due to <format>
-#endif
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <functional>
-#endif
-
// standard-mandated includes
#include <compare>
@@ -416,4 +408,12 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
+# include <chrono> // IGNORE-CYCLE due to <format>
+#endif
+
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <functional>
+#endif
+
#endif // _LIBCPP_THREAD
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index 01c59b3..7bf2f91 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -220,14 +220,6 @@ template <class... Types>
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <exception>
-# include <iosfwd>
-# include <new>
-# include <typeinfo>
-# include <utility>
-#endif
-
// standard-mandated includes
#include <compare>
@@ -1825,4 +1817,12 @@ _LIBCPP_NOEXCEPT_RETURN(
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <exception>
+# include <iosfwd>
+# include <new>
+# include <typeinfo>
+# include <utility>
+#endif
+
#endif // _LIBCPP_TUPLE
diff --git a/libcxx/include/typeindex b/libcxx/include/typeindex
index d1b750d..e3132c8 100644
--- a/libcxx/include/typeindex
+++ b/libcxx/include/typeindex
@@ -51,12 +51,6 @@ struct hash<type_index>
#include <typeinfo>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iosfwd>
-# include <new>
-# include <utility>
-#endif
-
// standard-mandated includes
#include <compare>
@@ -123,4 +117,10 @@ struct _LIBCPP_TEMPLATE_VIS hash<type_index>
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iosfwd>
+# include <new>
+# include <utility>
+#endif
+
#endif // _LIBCPP_TYPEINDEX
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index e0d659a..38de4d8 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -531,12 +531,6 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <tuple>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <bit>
-# include <iterator>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -2625,4 +2619,10 @@ operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <bit>
+# include <iterator>
+#endif
+
#endif // _LIBCPP_UNORDERED_MAP
diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set
index e294885..2440450 100644
--- a/libcxx/include/unordered_set
+++ b/libcxx/include/unordered_set
@@ -474,11 +474,6 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <__utility/forward.h>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <functional>
-# include <iterator>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -1801,4 +1796,9 @@ operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <functional>
+# include <iterator>
+#endif
+
#endif // _LIBCPP_UNORDERED_SET
diff --git a/libcxx/include/utility b/libcxx/include/utility
index d3a9aa4..41bcaf3 100644
--- a/libcxx/include/utility
+++ b/libcxx/include/utility
@@ -248,10 +248,6 @@ template <class T>
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <iosfwd>
-#endif
-
// standard-mandated includes
#include <compare>
#include <initializer_list>
@@ -260,4 +256,8 @@ template <class T>
# pragma GCC system_header
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <iosfwd>
+#endif
+
#endif // _LIBCPP_UTILITY
diff --git a/libcxx/include/valarray b/libcxx/include/valarray
index b47807c..ff745d3 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -360,11 +360,6 @@ template <class T> unspecified2 end(const valarray<T>& v);
#include <new>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <functional>
-#endif
-
// standard-mandated includes
#include <initializer_list>
@@ -4932,4 +4927,9 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <functional>
+#endif
+
#endif // _LIBCPP_VALARRAY
diff --git a/libcxx/include/variant b/libcxx/include/variant
index a4a3c5b..f1d36e2 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -228,11 +228,6 @@ namespace std {
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <typeinfo>
-# include <utility>
-#endif
-
// standard-mandated includes
#include <compare>
@@ -1818,4 +1813,9 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <typeinfo>
+# include <utility>
+#endif
+
#endif // _LIBCPP_VARIANT
diff --git a/libcxx/include/vector b/libcxx/include/vector
index 0786a51..8b27eaa 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -307,12 +307,6 @@ erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
#include <type_traits>
#include <version>
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <typeinfo>
-# include <utility>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -3324,4 +3318,10 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <algorithm>
+# include <typeinfo>
+# include <utility>
+#endif
+
#endif // _LIBCPP_VECTOR