diff --git a/libcxx/include/__algorithm/shuffle.h b/libcxx/include/__algorithm/shuffle.h --- a/libcxx/include/__algorithm/shuffle.h +++ b/libcxx/include/__algorithm/shuffle.h @@ -16,6 +16,7 @@ #include <__random/uniform_int_distribution.h> #include <__utility/forward.h> #include <__utility/move.h> +#include <__utility/swap.h> #include #include diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h --- a/libcxx/include/__algorithm/sort.h +++ b/libcxx/include/__algorithm/sort.h @@ -26,9 +26,12 @@ #include <__iterator/iterator_traits.h> #include <__memory/destruct_n.h> #include <__memory/unique_ptr.h> +#include <__type_traits/conditional.h> +#include <__type_traits/is_arithmetic.h> #include <__utility/move.h> #include <__utility/pair.h> #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__debug b/libcxx/include/__debug --- a/libcxx/include/__debug +++ b/libcxx/include/__debug @@ -12,8 +12,8 @@ #include <__assert> #include <__config> +#include <__type_traits/is_constant_evaluated.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__iterator/bounded_iter.h b/libcxx/include/__iterator/bounded_iter.h --- a/libcxx/include/__iterator/bounded_iter.h +++ b/libcxx/include/__iterator/bounded_iter.h @@ -14,8 +14,9 @@ #include <__config> #include <__iterator/iterator_traits.h> #include <__memory/pointer_traits.h> +#include <__type_traits/enable_if.h> +#include <__type_traits/is_convertible.h> #include <__utility/move.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__iterator/common_iterator.h b/libcxx/include/__iterator/common_iterator.h --- a/libcxx/include/__iterator/common_iterator.h +++ b/libcxx/include/__iterator/common_iterator.h @@ -25,6 +25,8 @@ #include <__iterator/iter_swap.h> #include <__iterator/iterator_traits.h> #include <__iterator/readable_traits.h> +#include <__type_traits/is_pointer.h> +#include <__utility/declval.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__iterator/counted_iterator.h b/libcxx/include/__iterator/counted_iterator.h --- a/libcxx/include/__iterator/counted_iterator.h +++ b/libcxx/include/__iterator/counted_iterator.h @@ -25,9 +25,10 @@ #include <__iterator/iterator_traits.h> #include <__iterator/readable_traits.h> #include <__memory/pointer_traits.h> +#include <__type_traits/add_pointer.h> +#include <__type_traits/conditional.h> #include <__utility/move.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__iterator/move_iterator.h b/libcxx/include/__iterator/move_iterator.h --- a/libcxx/include/__iterator/move_iterator.h +++ b/libcxx/include/__iterator/move_iterator.h @@ -24,8 +24,12 @@ #include <__iterator/iterator_traits.h> #include <__iterator/move_sentinel.h> #include <__iterator/readable_traits.h> +#include <__type_traits/conditional.h> +#include <__type_traits/is_assignable.h> +#include <__type_traits/is_constructible.h> +#include <__type_traits/is_same.h> +#include <__utility/declval.h> #include <__utility/move.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__iterator/projected.h b/libcxx/include/__iterator/projected.h --- a/libcxx/include/__iterator/projected.h +++ b/libcxx/include/__iterator/projected.h @@ -13,7 +13,7 @@ #include <__config> #include <__iterator/concepts.h> #include <__iterator/incrementable_traits.h> -#include +#include <__type_traits/remove_cvref.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__iterator/size.h b/libcxx/include/__iterator/size.h --- a/libcxx/include/__iterator/size.h +++ b/libcxx/include/__iterator/size.h @@ -11,8 +11,9 @@ #define _LIBCPP___ITERATOR_SIZE_H #include <__config> +#include <__type_traits/common_type.h> +#include <__type_traits/make_signed.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__iterator/wrap_iter.h b/libcxx/include/__iterator/wrap_iter.h --- a/libcxx/include/__iterator/wrap_iter.h +++ b/libcxx/include/__iterator/wrap_iter.h @@ -15,7 +15,8 @@ #include <__iterator/iterator_traits.h> #include <__memory/addressof.h> #include <__memory/pointer_traits.h> -#include +#include <__type_traits/enable_if.h> +#include <__type_traits/is_convertible.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__memory/uses_allocator_construction.h b/libcxx/include/__memory/uses_allocator_construction.h --- a/libcxx/include/__memory/uses_allocator_construction.h +++ b/libcxx/include/__memory/uses_allocator_construction.h @@ -14,6 +14,8 @@ #include <__memory/uses_allocator.h> #include <__type_traits/enable_if.h> #include <__type_traits/is_same.h> +#include <__type_traits/remove_cv.h> +#include <__utility/declval.h> #include <__utility/pair.h> #include diff --git a/libcxx/include/__tree b/libcxx/include/__tree --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -14,6 +14,7 @@ #include <__assert> #include <__config> #include <__debug> +#include <__functional/invoke.h> #include <__iterator/distance.h> #include <__iterator/iterator_traits.h> #include <__iterator/next.h> @@ -23,6 +24,17 @@ #include <__memory/swap_allocator.h> #include <__memory/unique_ptr.h> #include <__type_traits/can_extract_key.h> +#include <__type_traits/conditional.h> +#include <__type_traits/is_const.h> +#include <__type_traits/is_nothrow_copy_constructible.h> +#include <__type_traits/is_nothrow_default_constructible.h> +#include <__type_traits/is_nothrow_move_assignable.h> +#include <__type_traits/is_nothrow_move_constructible.h> +#include <__type_traits/is_pointer.h> +#include <__type_traits/is_same.h> +#include <__type_traits/is_swappable.h> +#include <__type_traits/remove_const_ref.h> +#include <__type_traits/remove_cvref.h> #include <__utility/forward.h> #include <__utility/move.h> #include <__utility/pair.h> diff --git a/libcxx/include/experimental/iterator b/libcxx/include/experimental/iterator --- a/libcxx/include/experimental/iterator +++ b/libcxx/include/experimental/iterator @@ -54,6 +54,7 @@ #include <__assert> // all public C++ headers provide the assertion handler #include <__memory/addressof.h> +#include <__type_traits/decay.h> #include <__utility/forward.h> #include <__utility/move.h> #include diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -1757,6 +1757,7 @@ # include # include # include +# include #endif #endif // _LIBCPP_FSTREAM diff --git a/libcxx/include/iterator b/libcxx/include/iterator --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -719,7 +719,6 @@ #include <__memory/pointer_traits.h> #include #include -#include #include // standard-mandated includes @@ -735,6 +734,7 @@ #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include # include +# include # include # include #endif diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -4365,6 +4365,7 @@ # include # include # include +# include #endif #endif // _LIBCPP_LOCALE 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 @@ -892,7 +892,10 @@ module hash { private header "__functional/hash.h" } module hash_fwd { private header "__fwd/hash.h" } module identity { private header "__functional/identity.h" } - module invoke { private header "__functional/invoke.h" } + module invoke { + private header "__functional/invoke.h" + export type_traits + } module is_transparent { private header "__functional/is_transparent.h" } module mem_fn { private header "__functional/mem_fn.h" } module mem_fun_ref { private header "__functional/mem_fun_ref.h" } @@ -1408,7 +1411,10 @@ module is_convertible { private header "__type_traits/is_convertible.h" } module is_copy_assignable { private header "__type_traits/is_copy_assignable.h" } module is_copy_constructible { private header "__type_traits/is_copy_constructible.h" } - module is_core_convertible { private header "__type_traits/is_core_convertible.h" } + module is_core_convertible { + private header "__type_traits/is_core_convertible.h" + export integral_constant + } module is_default_constructible { private header "__type_traits/is_default_constructible.h" } module is_destructible { private header "__type_traits/is_destructible.h" } module is_empty { private header "__type_traits/is_empty.h" } @@ -1469,7 +1475,10 @@ module is_unsigned { private header "__type_traits/is_unsigned.h" } module is_unsigned_integer { private header "__type_traits/is_unsigned_integer.h" } module is_valid_expansion { private header "__type_traits/is_valid_expansion.h" } - module is_void { private header "__type_traits/is_void.h" } + module is_void { + private header "__type_traits/is_void.h" + export integral_constant + } module is_volatile { private header "__type_traits/is_volatile.h" } module lazy { private header "__type_traits/lazy.h" } module make_32_64_or_128_bit { private header "__type_traits/make_32_64_or_128_bit.h" } diff --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator --- a/libcxx/include/scoped_allocator +++ b/libcxx/include/scoped_allocator @@ -118,6 +118,7 @@ #include <__type_traits/integral_constant.h> #include <__type_traits/is_constructible.h> #include <__type_traits/remove_reference.h> +#include <__utility/declval.h> #include <__utility/forward.h> #include <__utility/move.h> #include <__utility/pair.h> diff --git a/libcxx/include/tuple b/libcxx/include/tuple --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -205,11 +205,45 @@ #include <__compare/common_comparison_category.h> #include <__compare/synth_three_way.h> #include <__config> +#include <__functional/invoke.h> #include <__functional/unwrap_ref.h> #include <__fwd/array.h> #include <__memory/allocator_arg_t.h> #include <__memory/uses_allocator.h> +#include <__type_traits/apply_cv.h> +#include <__type_traits/common_reference.h> +#include <__type_traits/common_type.h> +#include <__type_traits/conditional.h> +#include <__type_traits/conjunction.h> +#include <__type_traits/copy_cvref.h> +#include <__type_traits/disjunction.h> +#include <__type_traits/is_arithmetic.h> +#include <__type_traits/is_assignable.h> +#include <__type_traits/is_constructible.h> +#include <__type_traits/is_convertible.h> +#include <__type_traits/is_copy_assignable.h> +#include <__type_traits/is_copy_constructible.h> +#include <__type_traits/is_default_constructible.h> +#include <__type_traits/is_empty.h> +#include <__type_traits/is_final.h> +#include <__type_traits/is_implicitly_default_constructible.h> +#include <__type_traits/is_move_assignable.h> +#include <__type_traits/is_move_constructible.h> +#include <__type_traits/is_nothrow_assignable.h> +#include <__type_traits/is_nothrow_constructible.h> +#include <__type_traits/is_nothrow_copy_assignable.h> +#include <__type_traits/is_nothrow_copy_constructible.h> +#include <__type_traits/is_nothrow_default_constructible.h> +#include <__type_traits/is_nothrow_move_assignable.h> +#include <__type_traits/is_reference.h> +#include <__type_traits/is_same.h> +#include <__type_traits/is_swappable.h> +#include <__type_traits/lazy.h> #include <__type_traits/maybe_const.h> +#include <__type_traits/nat.h> +#include <__type_traits/negation.h> +#include <__type_traits/remove_cvref.h> +#include <__type_traits/remove_reference.h> #include <__utility/forward.h> #include <__utility/integer_sequence.h> #include <__utility/move.h> @@ -217,7 +251,6 @@ #include <__utility/piecewise_construct.h> #include <__utility/swap.h> #include -#include #include // standard-mandated includes @@ -1823,6 +1856,7 @@ # include # include # include +# include # include #endif diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -211,9 +211,26 @@ #include <__compare/three_way_comparable.h> #include <__config> #include <__functional/hash.h> +#include <__functional/invoke.h> #include <__functional/operations.h> #include <__functional/unary_function.h> +#include <__type_traits/add_const.h> +#include <__type_traits/add_cv.h> +#include <__type_traits/add_pointer.h> +#include <__type_traits/add_volatile.h> #include <__type_traits/dependent_type.h> +#include <__type_traits/is_array.h> +#include <__type_traits/is_destructible.h> +#include <__type_traits/is_nothrow_move_constructible.h> +#include <__type_traits/is_trivially_copy_assignable.h> +#include <__type_traits/is_trivially_copy_constructible.h> +#include <__type_traits/is_trivially_destructible.h> +#include <__type_traits/is_trivially_move_assignable.h> +#include <__type_traits/is_trivially_move_constructible.h> +#include <__type_traits/is_void.h> +#include <__type_traits/remove_const.h> +#include <__type_traits/type_identity.h> +#include <__type_traits/void_t.h> #include <__utility/forward.h> #include <__utility/in_place.h> #include <__utility/move.h> @@ -224,7 +241,6 @@ #include #include #include -#include #include // standard-mandated includes @@ -1816,6 +1832,7 @@ #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include +# include # include #endif diff --git a/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/cpp20_iter_concepts.pass.cpp b/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/cpp20_iter_concepts.pass.cpp --- a/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/cpp20_iter_concepts.pass.cpp +++ b/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/cpp20_iter_concepts.pass.cpp @@ -19,9 +19,13 @@ // random_access_iterator_tag. // (1.4) -- Otherwise, ITER_CONCEPT(I) does not denote a type. +// ADDITIONAL_COMPILE_FLAGS: -Wno-private-header + #include "test_macros.h" +#include <__type_traits/is_valid_expansion.h> #include + struct OtherTag : std::input_iterator_tag {}; struct OtherTagTwo : std::output_iterator_tag {}; diff --git a/libcxx/test/libcxx/transitive_includes/cxx2b.csv b/libcxx/test/libcxx/transitive_includes/cxx2b.csv --- a/libcxx/test/libcxx/transitive_includes/cxx2b.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx2b.csv @@ -303,7 +303,6 @@ fstream mutex fstream ostream fstream string -fstream type_traits fstream typeinfo fstream version functional array @@ -365,7 +364,6 @@ iterator initializer_list iterator iosfwd iterator limits -iterator type_traits iterator variant iterator version latch atomic @@ -399,7 +397,6 @@ locale new locale streambuf locale string -locale type_traits locale version map compare map cstddef @@ -651,7 +648,6 @@ thread version tuple compare tuple cstddef -tuple type_traits tuple version type_traits cstddef type_traits cstdint @@ -717,7 +713,6 @@ variant limits variant new variant tuple -variant type_traits variant version vector climits vector compare diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/indirectly_readable.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/indirectly_readable.compile.pass.cpp --- a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/indirectly_readable.compile.pass.cpp +++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/indirectly_readable.compile.pass.cpp @@ -11,9 +11,9 @@ // template // concept indirectly_readable; -#include - #include +#include +#include #include "read_write.h" diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/iter_common_reference_t.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/iter_common_reference_t.compile.pass.cpp --- a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/iter_common_reference_t.compile.pass.cpp +++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.readable/iter_common_reference_t.compile.pass.cpp @@ -10,9 +10,9 @@ // iter_common_reference_t -#include - #include +#include +#include struct X { }; diff --git a/libcxx/test/std/iterators/predef.iterators/iterators.common/ctor.converting.pass.cpp b/libcxx/test/std/iterators/predef.iterators/iterators.common/ctor.converting.pass.cpp --- a/libcxx/test/std/iterators/predef.iterators/iterators.common/ctor.converting.pass.cpp +++ b/libcxx/test/std/iterators/predef.iterators/iterators.common/ctor.converting.pass.cpp @@ -12,10 +12,9 @@ // requires convertible_to && convertible_to // constexpr common_iterator(const common_iterator& x); -#include #include - -#include "test_macros.h" +#include +#include constexpr bool test() { diff --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/assign.converting.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/assign.converting.pass.cpp --- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/assign.converting.pass.cpp +++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/assign.converting.pass.cpp @@ -16,9 +16,10 @@ // requires assignable_from // constexpr move_sentinel& operator=(const move_sentinel& s); -#include #include #include +#include +#include struct NonAssignable { NonAssignable& operator=(int i); diff --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.converting.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.converting.pass.cpp --- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.converting.pass.cpp +++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.converting.pass.cpp @@ -16,9 +16,10 @@ // requires convertible_to // constexpr move_sentinel(const move_sentinel& s); -#include #include #include +#include +#include struct NonConvertible { explicit NonConvertible(); diff --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.sentinel.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.sentinel.pass.cpp --- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.sentinel.pass.cpp +++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/ctor.sentinel.pass.cpp @@ -14,8 +14,9 @@ // constexpr explicit move_sentinel(S s); -#include #include +#include +#include constexpr bool test() { diff --git a/libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp --- a/libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp @@ -12,8 +12,9 @@ // UNSUPPORTED: c++03 -#include #include +#include +#include #include "test_macros.h" diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp @@ -17,9 +17,10 @@ // // See https://llvm.org/PR22806. -#include -#include #include +#include +#include +#include #include "test_macros.h" diff --git a/libcxx/test/support/min_allocator.h b/libcxx/test/support/min_allocator.h --- a/libcxx/test/support/min_allocator.h +++ b/libcxx/test/support/min_allocator.h @@ -9,14 +9,14 @@ #ifndef MIN_ALLOCATOR_H #define MIN_ALLOCATOR_H -#include -#include -#include #include #include +#include +#include #include #include #include +#include #include "test_macros.h"