diff --git a/libcxx/include/__concepts/arithmetic.h b/libcxx/include/__concepts/arithmetic.h --- a/libcxx/include/__concepts/arithmetic.h +++ b/libcxx/include/__concepts/arithmetic.h @@ -10,9 +10,11 @@ #define _LIBCPP___CONCEPTS_ARITHMETIC_H #include <__config> +#include <__type_traits/is_floating_point.h> +#include <__type_traits/is_integral.h> +#include <__type_traits/is_signed.h> #include <__type_traits/is_signed_integer.h> #include <__type_traits/is_unsigned_integer.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/assignable.h b/libcxx/include/__concepts/assignable.h --- a/libcxx/include/__concepts/assignable.h +++ b/libcxx/include/__concepts/assignable.h @@ -12,9 +12,9 @@ #include <__concepts/common_reference_with.h> #include <__concepts/same_as.h> #include <__config> +#include <__type_traits/is_reference.h> #include <__type_traits/make_const_lvalue_ref.h> #include <__utility/forward.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/class_or_enum.h b/libcxx/include/__concepts/class_or_enum.h --- a/libcxx/include/__concepts/class_or_enum.h +++ b/libcxx/include/__concepts/class_or_enum.h @@ -10,7 +10,10 @@ #define _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H #include <__config> -#include +#include <__type_traits/is_class.h> +#include <__type_traits/is_enum.h> +#include <__type_traits/is_union.h> +#include <__type_traits/remove_cvref.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/common_reference_with.h b/libcxx/include/__concepts/common_reference_with.h --- a/libcxx/include/__concepts/common_reference_with.h +++ b/libcxx/include/__concepts/common_reference_with.h @@ -12,7 +12,7 @@ #include <__concepts/convertible_to.h> #include <__concepts/same_as.h> #include <__config> -#include +#include <__type_traits/common_reference.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/common_with.h b/libcxx/include/__concepts/common_with.h --- a/libcxx/include/__concepts/common_with.h +++ b/libcxx/include/__concepts/common_with.h @@ -12,7 +12,10 @@ #include <__concepts/common_reference_with.h> #include <__concepts/same_as.h> #include <__config> -#include +#include <__type_traits/add_lvalue_reference.h> +#include <__type_traits/common_reference.h> +#include <__type_traits/common_type.h> +#include <__utility/declval.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/constructible.h b/libcxx/include/__concepts/constructible.h --- a/libcxx/include/__concepts/constructible.h +++ b/libcxx/include/__concepts/constructible.h @@ -12,7 +12,7 @@ #include <__concepts/convertible_to.h> #include <__concepts/destructible.h> #include <__config> -#include +#include <__type_traits/is_constructible.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/convertible_to.h b/libcxx/include/__concepts/convertible_to.h --- a/libcxx/include/__concepts/convertible_to.h +++ b/libcxx/include/__concepts/convertible_to.h @@ -10,8 +10,8 @@ #define _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H #include <__config> +#include <__type_traits/is_convertible.h> #include <__utility/declval.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/derived_from.h b/libcxx/include/__concepts/derived_from.h --- a/libcxx/include/__concepts/derived_from.h +++ b/libcxx/include/__concepts/derived_from.h @@ -10,7 +10,8 @@ #define _LIBCPP___CONCEPTS_DERIVED_FROM_H #include <__config> -#include +#include <__type_traits/is_base_of.h> +#include <__type_traits/is_convertible.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/destructible.h b/libcxx/include/__concepts/destructible.h --- a/libcxx/include/__concepts/destructible.h +++ b/libcxx/include/__concepts/destructible.h @@ -10,7 +10,7 @@ #define _LIBCPP___CONCEPTS_DESTRUCTIBLE_H #include <__config> -#include +#include <__type_traits/is_nothrow_destructible.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/different_from.h b/libcxx/include/__concepts/different_from.h --- a/libcxx/include/__concepts/different_from.h +++ b/libcxx/include/__concepts/different_from.h @@ -11,7 +11,7 @@ #include <__concepts/same_as.h> #include <__config> -#include +#include <__type_traits/remove_cvref.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/equality_comparable.h b/libcxx/include/__concepts/equality_comparable.h --- a/libcxx/include/__concepts/equality_comparable.h +++ b/libcxx/include/__concepts/equality_comparable.h @@ -12,8 +12,8 @@ #include <__concepts/boolean_testable.h> #include <__concepts/common_reference_with.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/__concepts/invocable.h b/libcxx/include/__concepts/invocable.h --- a/libcxx/include/__concepts/invocable.h +++ b/libcxx/include/__concepts/invocable.h @@ -12,7 +12,6 @@ #include <__config> #include <__functional/invoke.h> #include <__utility/forward.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/movable.h b/libcxx/include/__concepts/movable.h --- a/libcxx/include/__concepts/movable.h +++ b/libcxx/include/__concepts/movable.h @@ -13,7 +13,7 @@ #include <__concepts/constructible.h> #include <__concepts/swappable.h> #include <__config> -#include +#include <__type_traits/is_object.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/predicate.h b/libcxx/include/__concepts/predicate.h --- a/libcxx/include/__concepts/predicate.h +++ b/libcxx/include/__concepts/predicate.h @@ -12,7 +12,7 @@ #include <__concepts/boolean_testable.h> #include <__concepts/invocable.h> #include <__config> -#include +#include <__functional/invoke.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/same_as.h b/libcxx/include/__concepts/same_as.h --- a/libcxx/include/__concepts/same_as.h +++ b/libcxx/include/__concepts/same_as.h @@ -10,7 +10,7 @@ #define _LIBCPP___CONCEPTS_SAME_AS_H #include <__config> -#include +#include <__type_traits/is_same.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/swappable.h b/libcxx/include/__concepts/swappable.h --- a/libcxx/include/__concepts/swappable.h +++ b/libcxx/include/__concepts/swappable.h @@ -14,11 +14,15 @@ #include <__concepts/common_reference_with.h> #include <__concepts/constructible.h> #include <__config> +#include <__type_traits/extent.h> +#include <__type_traits/is_nothrow_move_assignable.h> +#include <__type_traits/is_nothrow_move_constructible.h> +#include <__type_traits/remove_cvref.h> #include <__utility/exchange.h> #include <__utility/forward.h> #include <__utility/move.h> #include <__utility/swap.h> -#include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__concepts/totally_ordered.h b/libcxx/include/__concepts/totally_ordered.h --- a/libcxx/include/__concepts/totally_ordered.h +++ b/libcxx/include/__concepts/totally_ordered.h @@ -12,7 +12,8 @@ #include <__concepts/boolean_testable.h> #include <__concepts/equality_comparable.h> #include <__config> -#include +#include <__type_traits/common_reference.h> +#include <__type_traits/make_const_lvalue_ref.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__type_traits/is_nothrow_constructible.h b/libcxx/include/__type_traits/is_nothrow_constructible.h --- a/libcxx/include/__type_traits/is_nothrow_constructible.h +++ b/libcxx/include/__type_traits/is_nothrow_constructible.h @@ -14,6 +14,7 @@ #include <__type_traits/is_constructible.h> #include <__type_traits/is_reference.h> #include <__utility/declval.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__type_traits/is_signed.h b/libcxx/include/__type_traits/is_signed.h --- a/libcxx/include/__type_traits/is_signed.h +++ b/libcxx/include/__type_traits/is_signed.h @@ -11,6 +11,8 @@ #include <__config> #include <__type_traits/integral_constant.h> +#include <__type_traits/is_arithmetic.h> +#include <__type_traits/is_integral.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__type_traits/remove_cvref.h b/libcxx/include/__type_traits/remove_cvref.h --- a/libcxx/include/__type_traits/remove_cvref.h +++ b/libcxx/include/__type_traits/remove_cvref.h @@ -12,6 +12,7 @@ #include <__config> #include <__type_traits/is_same.h> #include <__type_traits/remove_cv.h> +#include <__type_traits/remove_cvref.h> #include <__type_traits/remove_reference.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__utility/swap.h b/libcxx/include/__utility/swap.h --- a/libcxx/include/__utility/swap.h +++ b/libcxx/include/__utility/swap.h @@ -10,10 +10,14 @@ #define _LIBCPP___UTILITY_SWAP_H #include <__config> +#include <__type_traits/is_move_assignable.h> +#include <__type_traits/is_move_constructible.h> +#include <__type_traits/is_nothrow_move_assignable.h> +#include <__type_traits/is_nothrow_move_constructible.h> +#include <__type_traits/is_swappable.h> #include <__utility/declval.h> #include <__utility/move.h> #include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/concepts b/libcxx/include/concepts --- a/libcxx/include/concepts +++ b/libcxx/include/concepts @@ -155,6 +155,10 @@ #include <__config> #include +#if _LIBCPP_STD_VER <= 20 && !defined(_LIPCPP_REMOVE_TRANSITIVE_INCLUDES) +# include +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif 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 @@ -1436,7 +1436,10 @@ module is_reference { private header "__type_traits/is_reference.h" } module is_reference_wrapper { private header "__type_traits/is_reference_wrapper.h" } module is_referenceable { private header "__type_traits/is_referenceable.h" } - module is_same { private header "__type_traits/is_same.h" } + module is_same { + private header "__type_traits/is_same.h" + export type_traits.integral_constant + } module is_scalar { private header "__type_traits/is_scalar.h" } module is_scoped_enum { private header "__type_traits/is_scoped_enum.h" } module is_signed { private header "__type_traits/is_signed.h" } diff --git a/libcxx/include/sstream b/libcxx/include/sstream --- a/libcxx/include/sstream +++ b/libcxx/include/sstream @@ -876,4 +876,8 @@ _LIBCPP_POP_MACROS +#if _LIBCPP_STD_VER <= 20 && !defined(_LIPCPP_REMOVE_TRANSITIVE_INCLUDES) +# include +#endif + #endif // _LIBCPP_SSTREAM diff --git a/libcxx/test/libcxx/ranges/range.utility.helpers/different_from.compile.pass.cpp b/libcxx/test/libcxx/ranges/range.utility.helpers/different_from.compile.pass.cpp --- a/libcxx/test/libcxx/ranges/range.utility.helpers/different_from.compile.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.utility.helpers/different_from.compile.pass.cpp @@ -10,9 +10,10 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 -#include +// Check that different_from.h is self-contained +// ADDITIONAL_COMPILE_FLAGS: -Wno-private-header -#include "test_macros.h" +#include <__concepts/different_from.h> static_assert(std::__different_from); static_assert(std::__different_from); @@ -25,4 +26,3 @@ static_assert(!std::__different_from); static_assert(!std::__different_from); static_assert(std::__different_from); -