diff --git a/libcxx/include/__compare/common_comparison_category.h b/libcxx/include/__compare/common_comparison_category.h --- a/libcxx/include/__compare/common_comparison_category.h +++ b/libcxx/include/__compare/common_comparison_category.h @@ -11,7 +11,8 @@ #include <__compare/ordering.h> #include <__config> -#include +#include <__type_traits/is_same.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__compare/ordering.h b/libcxx/include/__compare/ordering.h --- a/libcxx/include/__compare/ordering.h +++ b/libcxx/include/__compare/ordering.h @@ -10,7 +10,8 @@ #define _LIBCPP___COMPARE_ORDERING_H #include <__config> -#include +#include <__type_traits/enable_if.h> +#include <__type_traits/is_same.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__compare/three_way_comparable.h b/libcxx/include/__compare/three_way_comparable.h --- a/libcxx/include/__compare/three_way_comparable.h +++ b/libcxx/include/__compare/three_way_comparable.h @@ -16,8 +16,8 @@ #include <__concepts/same_as.h> #include <__concepts/totally_ordered.h> #include <__config> +#include <__type_traits/common_reference.h> #include <__type_traits/make_const_lvalue_ref.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__functional/unwrap_ref.h b/libcxx/include/__functional/unwrap_ref.h --- a/libcxx/include/__functional/unwrap_ref.h +++ b/libcxx/include/__functional/unwrap_ref.h @@ -10,6 +10,7 @@ #define _LIBCPP___FUNCTIONAL_UNWRAP_REF_H #include <__config> +#include <__type_traits/decay.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/as_const.h b/libcxx/include/__utility/as_const.h --- a/libcxx/include/__utility/as_const.h +++ b/libcxx/include/__utility/as_const.h @@ -10,9 +10,9 @@ #define _LIBCPP___UTILITY_AS_CONST_H #include <__config> +#include <__type_traits/add_const.h> #include <__utility/forward.h> #include <__utility/move.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/auto_cast.h b/libcxx/include/__utility/auto_cast.h --- a/libcxx/include/__utility/auto_cast.h +++ b/libcxx/include/__utility/auto_cast.h @@ -11,7 +11,7 @@ #define _LIBCPP___UTILITY_AUTO_CAST_H #include <__config> -#include +#include <__type_traits/decay.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/cmp.h b/libcxx/include/__utility/cmp.h --- a/libcxx/include/__utility/cmp.h +++ b/libcxx/include/__utility/cmp.h @@ -10,10 +10,14 @@ #define _LIBCPP___UTILITY_CMP_H #include <__config> +#include <__type_traits/disjunction.h> +#include <__type_traits/is_integral.h> +#include <__type_traits/is_same.h> +#include <__type_traits/is_signed.h> +#include <__type_traits/make_unsigned.h> #include <__utility/forward.h> #include <__utility/move.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/exchange.h b/libcxx/include/__utility/exchange.h --- a/libcxx/include/__utility/exchange.h +++ b/libcxx/include/__utility/exchange.h @@ -10,9 +10,10 @@ #define _LIBCPP___UTILITY_EXCHANGE_H #include <__config> +#include <__type_traits/is_nothrow_assignable.h> +#include <__type_traits/is_nothrow_move_constructible.h> #include <__utility/forward.h> #include <__utility/move.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/in_place.h b/libcxx/include/__utility/in_place.h --- a/libcxx/include/__utility/in_place.h +++ b/libcxx/include/__utility/in_place.h @@ -10,7 +10,8 @@ #define _LIBCPP___UTILITY_IN_PLACE_H #include <__config> -#include +#include <__type_traits/remove_cvref.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/integer_sequence.h b/libcxx/include/__utility/integer_sequence.h --- a/libcxx/include/__utility/integer_sequence.h +++ b/libcxx/include/__utility/integer_sequence.h @@ -10,7 +10,8 @@ #define _LIBCPP___UTILITY_INTEGER_SEQUENCE_H #include <__config> -#include +#include <__type_traits/is_integral.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/move.h b/libcxx/include/__utility/move.h --- a/libcxx/include/__utility/move.h +++ b/libcxx/include/__utility/move.h @@ -11,7 +11,10 @@ #define _LIBCPP___UTILITY_MOVE_H #include <__config> -#include +#include <__type_traits/conditional.h> +#include <__type_traits/is_copy_constructible.h> +#include <__type_traits/is_nothrow_move_constructible.h> +#include <__type_traits/remove_reference.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h --- a/libcxx/include/__utility/pair.h +++ b/libcxx/include/__utility/pair.h @@ -19,12 +19,29 @@ #include <__tuple/tuple_element.h> #include <__tuple/tuple_indices.h> #include <__tuple/tuple_size.h> +#include <__type_traits/common_reference.h> +#include <__type_traits/common_type.h> +#include <__type_traits/conditional.h> +#include <__type_traits/is_assignable.h> +#include <__type_traits/is_constructible.h> +#include <__type_traits/is_convertible.h> +#include <__type_traits/is_copy_assignable.h> +#include <__type_traits/is_default_constructible.h> #include <__type_traits/is_implicitly_default_constructible.h> +#include <__type_traits/is_move_assignable.h> +#include <__type_traits/is_nothrow_assignable.h> +#include <__type_traits/is_nothrow_constructible.h> +#include <__type_traits/is_nothrow_copy_assignable.h> +#include <__type_traits/is_nothrow_copy_constructible.h> +#include <__type_traits/is_nothrow_default_constructible.h> +#include <__type_traits/is_nothrow_move_assignable.h> +#include <__type_traits/is_same.h> +#include <__type_traits/is_swappable.h> +#include <__type_traits/nat.h> #include <__utility/forward.h> #include <__utility/move.h> #include <__utility/piecewise_construct.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/rel_ops.h b/libcxx/include/__utility/rel_ops.h --- a/libcxx/include/__utility/rel_ops.h +++ b/libcxx/include/__utility/rel_ops.h @@ -10,9 +10,6 @@ #define _LIBCPP___UTILITY_REL_OPS_H #include <__config> -#include <__utility/forward.h> -#include <__utility/move.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__utility/to_underlying.h b/libcxx/include/__utility/to_underlying.h --- a/libcxx/include/__utility/to_underlying.h +++ b/libcxx/include/__utility/to_underlying.h @@ -11,7 +11,7 @@ #define _LIBCPP___UTILITY_TO_UNDERLYING_H #include <__config> -#include +#include <__type_traits/underlying_type.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/limits b/libcxx/include/limits --- a/libcxx/include/limits +++ b/libcxx/include/limits @@ -104,7 +104,9 @@ #include <__assert> // all public C++ headers provide the assertion handler #include <__config> -#include +#include <__type_traits/is_arithmetic.h> +#include <__type_traits/is_signed.h> +#include <__type_traits/remove_cv.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -821,4 +823,8 @@ _LIBCPP_POP_MACROS +#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include +#endif + #endif // _LIBCPP_LIMITS diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in --- a/libcxx/include/module.modulemap.in +++ b/libcxx/include/module.modulemap.in @@ -1386,7 +1386,10 @@ module is_abstract { private header "__type_traits/is_abstract.h" } module is_aggregate { private header "__type_traits/is_aggregate.h" } module is_allocator { private header "__type_traits/is_allocator.h" } - module is_arithmetic { private header "__type_traits/is_arithmetic.h" } + module is_arithmetic { + private header "__type_traits/is_arithmetic.h" + export integral_constant + } module is_array { private header "__type_traits/is_array.h" } module is_assignable { private header "__type_traits/is_assignable.h" } module is_base_of { private header "__type_traits/is_base_of.h" } diff --git a/libcxx/include/utility b/libcxx/include/utility --- a/libcxx/include/utility +++ b/libcxx/include/utility @@ -257,7 +257,6 @@ #include <__utility/to_underlying.h> #include <__utility/transaction.h> #include <__utility/unreachable.h> -#include #include // standard-mandated includes @@ -276,6 +275,7 @@ #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include +# include #endif #endif // _LIBCPP_UTILITY diff --git a/libcxx/test/libcxx/transitive_includes/cxx03.csv b/libcxx/test/libcxx/transitive_includes/cxx03.csv --- a/libcxx/test/libcxx/transitive_includes/cxx03.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx03.csv @@ -563,7 +563,6 @@ memory_resource new memory_resource stdexcept memory_resource tuple -memory_resource type_traits memory_resource version mutex atomic mutex concepts diff --git a/libcxx/test/libcxx/transitive_includes/cxx11.csv b/libcxx/test/libcxx/transitive_includes/cxx11.csv --- a/libcxx/test/libcxx/transitive_includes/cxx11.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx11.csv @@ -563,7 +563,6 @@ memory_resource new memory_resource stdexcept memory_resource tuple -memory_resource type_traits memory_resource version mutex atomic mutex concepts diff --git a/libcxx/test/libcxx/transitive_includes/cxx14.csv b/libcxx/test/libcxx/transitive_includes/cxx14.csv --- a/libcxx/test/libcxx/transitive_includes/cxx14.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx14.csv @@ -565,7 +565,6 @@ memory_resource new memory_resource stdexcept memory_resource tuple -memory_resource type_traits memory_resource version mutex atomic mutex concepts diff --git a/libcxx/test/libcxx/transitive_includes/cxx17.csv b/libcxx/test/libcxx/transitive_includes/cxx17.csv --- a/libcxx/test/libcxx/transitive_includes/cxx17.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx17.csv @@ -565,7 +565,6 @@ memory_resource new memory_resource stdexcept memory_resource tuple -memory_resource type_traits memory_resource version mutex atomic mutex concepts diff --git a/libcxx/test/libcxx/transitive_includes/cxx20.csv b/libcxx/test/libcxx/transitive_includes/cxx20.csv --- a/libcxx/test/libcxx/transitive_includes/cxx20.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx20.csv @@ -576,7 +576,6 @@ memory_resource new memory_resource stdexcept memory_resource tuple -memory_resource type_traits memory_resource version mutex atomic mutex concepts diff --git a/libcxx/test/libcxx/transitive_includes/cxx2b.csv b/libcxx/test/libcxx/transitive_includes/cxx2b.csv --- a/libcxx/test/libcxx/transitive_includes/cxx2b.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx2b.csv @@ -122,7 +122,6 @@ complex type_traits complex version concepts cstddef -concepts type_traits concepts version condition_variable atomic condition_variable cstddef @@ -197,7 +196,6 @@ experimental/iterator cstddef experimental/iterator iosfwd experimental/iterator iterator -experimental/iterator type_traits experimental/list experimental/memory_resource experimental/list list experimental/map experimental/memory_resource @@ -381,7 +379,6 @@ latch atomic latch limits latch version -limits type_traits limits version list compare list cstddef @@ -445,7 +442,6 @@ memory_resource new memory_resource stdexcept memory_resource tuple -memory_resource type_traits memory_resource version mutex atomic mutex cstddef @@ -598,7 +594,6 @@ sstream istream sstream ostream sstream string -sstream type_traits sstream version stack compare stack cstddef @@ -717,7 +712,6 @@ utility cstdlib utility initializer_list utility limits -utility type_traits utility version valarray cmath valarray cstddef diff --git a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/U_V.pass.cpp b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/U_V.pass.cpp --- a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/U_V.pass.cpp +++ b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/U_V.pass.cpp @@ -14,6 +14,7 @@ // template pair(U&& x, V&& y); +#include #include #include "test_macros.h" diff --git a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp --- a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp +++ b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp @@ -14,11 +14,9 @@ // pair(const T1& x, const T2& y); +#include #include -#include "test_macros.h" - - struct ExplicitT { constexpr explicit ExplicitT(int x) : value(x) {} constexpr explicit ExplicitT(ExplicitT const& o) : value(o.value) {} diff --git a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp --- a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp +++ b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp @@ -14,6 +14,7 @@ // template EXPLICIT constexpr pair(const pair& p); +#include #include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/expected/expected.unexpected/swap/swap.free.pass.cpp b/libcxx/test/std/utilities/expected/expected.unexpected/swap/swap.free.pass.cpp --- a/libcxx/test/std/utilities/expected/expected.unexpected/swap/swap.free.pass.cpp +++ b/libcxx/test/std/utilities/expected/expected.unexpected/swap/swap.free.pass.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include // test noexcept diff --git a/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp b/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp --- a/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp +++ b/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp @@ -25,8 +25,9 @@ // void // return_temporary_buffer(T* p); -#include #include +#include +#include #include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/utility/as_const/as_const.pass.cpp b/libcxx/test/std/utilities/utility/as_const/as_const.pass.cpp --- a/libcxx/test/std/utilities/utility/as_const/as_const.pass.cpp +++ b/libcxx/test/std/utilities/utility/as_const/as_const.pass.cpp @@ -11,10 +11,9 @@ // template constexpr add_const& as_const(T& t) noexcept; // C++17 // template add_const& as_const(const T&&) = delete; // C++17 -#include #include - -#include "test_macros.h" +#include +#include struct S {int i;}; bool operator==(const S& x, const S& y) { return x.i == y.i; } diff --git a/libcxx/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp b/libcxx/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp --- a/libcxx/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp +++ b/libcxx/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp @@ -19,6 +19,7 @@ // >::type // move_if_noexcept(T& x); +#include #include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.pass.cpp --- a/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.pass.cpp @@ -12,10 +12,9 @@ // tuple_element >::type +#include #include -#include "test_macros.h" - template void test() { diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp --- a/libcxx/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp @@ -14,9 +14,10 @@ // pair(pair&&) = default; -#include -#include #include +#include +#include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp --- a/libcxx/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp @@ -13,8 +13,9 @@ // pair(pair const&) = default; // pair(pair&&) = default; -#include #include +#include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.spec/non_member_const_swap.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.spec/non_member_const_swap.pass.cpp --- a/libcxx/test/std/utilities/utility/pairs/pairs.spec/non_member_const_swap.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pairs.spec/non_member_const_swap.pass.cpp @@ -14,6 +14,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 #include +#include #include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp b/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp --- a/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp +++ b/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp @@ -29,11 +29,10 @@ // template // inline constexpr in_place_index_t in_place_index{}; -#include #include #include - -#include "test_macros.h" +#include +#include template constexpr bool check_tag(Up) { diff --git a/libcxxabi/src/cxa_guard_impl.h b/libcxxabi/src/cxa_guard_impl.h --- a/libcxxabi/src/cxa_guard_impl.h +++ b/libcxxabi/src/cxa_guard_impl.h @@ -56,6 +56,7 @@ #endif #include <__threading_support> +#include #include #include #include