[libcxx-commits] [libcxx] e698c59 - [libc++] Granularize <type_traits> includes in <algorithm>
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Feb 13 04:21:31 PST 2023
Author: Nikolas Klauser
Date: 2023-02-13T13:21:25+01:00
New Revision: e698c5950430289128a6a6753b90eb0e65ddc388
URL: https://github.com/llvm/llvm-project/commit/e698c5950430289128a6a6753b90eb0e65ddc388
DIFF: https://github.com/llvm/llvm-project/commit/e698c5950430289128a6a6753b90eb0e65ddc388.diff
LOG: [libc++] Granularize <type_traits> includes in <algorithm>
Reviewed By: Mordante, #libc
Spies: libcxx-commits, wenlei
Differential Revision: https://reviews.llvm.org/D140673
Added:
Modified:
libcxx/docs/ReleaseNotes.rst
libcxx/include/__algorithm/copy_n.h
libcxx/include/__algorithm/fill.h
libcxx/include/__algorithm/fill_n.h
libcxx/include/__algorithm/find_end.h
libcxx/include/__algorithm/for_each_n.h
libcxx/include/__algorithm/generate_n.h
libcxx/include/__algorithm/half_positive.h
libcxx/include/__algorithm/is_permutation.h
libcxx/include/__algorithm/lower_bound.h
libcxx/include/__algorithm/minmax_element.h
libcxx/include/__algorithm/partial_sort.h
libcxx/include/__algorithm/partition.h
libcxx/include/__algorithm/pop_heap.h
libcxx/include/__algorithm/push_heap.h
libcxx/include/__algorithm/ranges_merge.h
libcxx/include/__algorithm/ranges_minmax_element.h
libcxx/include/__algorithm/ranges_partition.h
libcxx/include/__algorithm/ranges_partition_copy.h
libcxx/include/__algorithm/ranges_sample.h
libcxx/include/__algorithm/ranges_shuffle.h
libcxx/include/__algorithm/ranges_stable_partition.h
libcxx/include/__algorithm/rotate.h
libcxx/include/__algorithm/sample.h
libcxx/include/__algorithm/search.h
libcxx/include/__algorithm/search_n.h
libcxx/include/__algorithm/set_difference.h
libcxx/include/__algorithm/shift_left.h
libcxx/include/__algorithm/shift_right.h
libcxx/include/__algorithm/sort_heap.h
libcxx/include/__algorithm/stable_partition.h
libcxx/include/__algorithm/stable_sort.h
libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
libcxx/include/__random/is_valid.h
libcxx/include/__random/log2.h
libcxx/include/__random/uniform_int_distribution.h
libcxx/include/__random/uniform_random_bit_generator.h
libcxx/include/algorithm
libcxx/include/regex
libcxx/include/valarray
libcxx/test/libcxx/transitive_includes/cxx2b.csv
Removed:
################################################################################
diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index 20b2b09cdaf60..d86a96b3cf6d1 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -53,6 +53,12 @@ Deprecations and Removals
has been shipping since LLVM 14, so the Coroutines TS implementation is being removed per our policy
for removing TSes.
+- Several incidental transitive includes have been removed from libc++. Those
+ includes are removed based on the language version used. Incidental transitive
+ inclusions of the following headers have been removed:
+
+ - C++2b: ``type_traits``
+
Upcoming Deprecations and Removals
----------------------------------
diff --git a/libcxx/include/__algorithm/copy_n.h b/libcxx/include/__algorithm/copy_n.h
index b08bbdfb9b7ec..7089ef3825a7a 100644
--- a/libcxx/include/__algorithm/copy_n.h
+++ b/libcxx/include/__algorithm/copy_n.h
@@ -12,8 +12,8 @@
#include <__algorithm/copy.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/fill.h b/libcxx/include/__algorithm/fill.h
index 76cf4a1477a65..0753c427ae4ed 100644
--- a/libcxx/include/__algorithm/fill.h
+++ b/libcxx/include/__algorithm/fill.h
@@ -12,7 +12,6 @@
#include <__algorithm/fill_n.h>
#include <__config>
#include <__iterator/iterator_traits.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/fill_n.h b/libcxx/include/__algorithm/fill_n.h
index fe58c8d641781..e7863ac7ec7e8 100644
--- a/libcxx/include/__algorithm/fill_n.h
+++ b/libcxx/include/__algorithm/fill_n.h
@@ -12,7 +12,6 @@
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/find_end.h b/libcxx/include/__algorithm/find_end.h
index e2fee6b3c4596..edb9891c66f70 100644
--- a/libcxx/include/__algorithm/find_end.h
+++ b/libcxx/include/__algorithm/find_end.h
@@ -15,12 +15,12 @@
#include <__algorithm/search.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/advance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
#include <__iterator/reverse_iterator.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/for_each_n.h b/libcxx/include/__algorithm/for_each_n.h
index 38d204a11819d..85cf41dc278d7 100644
--- a/libcxx/include/__algorithm/for_each_n.h
+++ b/libcxx/include/__algorithm/for_each_n.h
@@ -12,7 +12,6 @@
#include <__config>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/generate_n.h b/libcxx/include/__algorithm/generate_n.h
index 45259989bf0e4..ff5c82d3e4221 100644
--- a/libcxx/include/__algorithm/generate_n.h
+++ b/libcxx/include/__algorithm/generate_n.h
@@ -11,7 +11,6 @@
#include <__config>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/half_positive.h b/libcxx/include/__algorithm/half_positive.h
index 74aede2b56686..5a0f4baf6aaaf 100644
--- a/libcxx/include/__algorithm/half_positive.h
+++ b/libcxx/include/__algorithm/half_positive.h
@@ -10,7 +10,9 @@
#define _LIBCPP___ALGORITHM_HALF_POSITIVE_H
#include <__config>
-#include <type_traits>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/make_unsigned.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/is_permutation.h b/libcxx/include/__algorithm/is_permutation.h
index 005445652e9df..8337680229042 100644
--- a/libcxx/include/__algorithm/is_permutation.h
+++ b/libcxx/include/__algorithm/is_permutation.h
@@ -19,8 +19,8 @@
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
+#include <__type_traits/is_callable.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/lower_bound.h b/libcxx/include/__algorithm/lower_bound.h
index 2648982ea506b..8109393757617 100644
--- a/libcxx/include/__algorithm/lower_bound.h
+++ b/libcxx/include/__algorithm/lower_bound.h
@@ -20,7 +20,6 @@
#include <__iterator/iterator_traits.h>
#include <__type_traits/is_callable.h>
#include <__type_traits/remove_reference.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/minmax_element.h b/libcxx/include/__algorithm/minmax_element.h
index caa963e112e13..1ac407868a6c3 100644
--- a/libcxx/include/__algorithm/minmax_element.h
+++ b/libcxx/include/__algorithm/minmax_element.h
@@ -12,9 +12,10 @@
#include <__algorithm/comp.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_callable.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/partial_sort.h b/libcxx/include/__algorithm/partial_sort.h
index e0812affe6b51..4b8e0e76b7a23 100644
--- a/libcxx/include/__algorithm/partial_sort.h
+++ b/libcxx/include/__algorithm/partial_sort.h
@@ -19,8 +19,9 @@
#include <__debug>
#include <__debug_utils/randomize_range.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/partition.h b/libcxx/include/__algorithm/partition.h
index 0e094bf8dd924..a58dd6464aae2 100644
--- a/libcxx/include/__algorithm/partition.h
+++ b/libcxx/include/__algorithm/partition.h
@@ -14,7 +14,6 @@
#include <__iterator/iterator_traits.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/pop_heap.h b/libcxx/include/__algorithm/pop_heap.h
index 94d32a42391bf..4187523ef9707 100644
--- a/libcxx/include/__algorithm/pop_heap.h
+++ b/libcxx/include/__algorithm/pop_heap.h
@@ -17,8 +17,9 @@
#include <__assert>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/push_heap.h b/libcxx/include/__algorithm/push_heap.h
index 90684957744df..e831162a81c9c 100644
--- a/libcxx/include/__algorithm/push_heap.h
+++ b/libcxx/include/__algorithm/push_heap.h
@@ -14,8 +14,9 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/ranges_merge.h b/libcxx/include/__algorithm/ranges_merge.h
index b36a05abc41e1..8935173bf81b8 100644
--- a/libcxx/include/__algorithm/ranges_merge.h
+++ b/libcxx/include/__algorithm/ranges_merge.h
@@ -20,8 +20,8 @@
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/ranges_minmax_element.h b/libcxx/include/__algorithm/ranges_minmax_element.h
index 6699f9626e1bf..e12889dc3b372 100644
--- a/libcxx/include/__algorithm/ranges_minmax_element.h
+++ b/libcxx/include/__algorithm/ranges_minmax_element.h
@@ -23,7 +23,6 @@
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/ranges_partition.h b/libcxx/include/__algorithm/ranges_partition.h
index 8b3aae5c250d8..b01b189ae7599 100644
--- a/libcxx/include/__algorithm/ranges_partition.h
+++ b/libcxx/include/__algorithm/ranges_partition.h
@@ -27,7 +27,6 @@
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/ranges_partition_copy.h b/libcxx/include/__algorithm/ranges_partition_copy.h
index e7a9a347df5ad..591fddf5cb637 100644
--- a/libcxx/include/__algorithm/ranges_partition_copy.h
+++ b/libcxx/include/__algorithm/ranges_partition_copy.h
@@ -20,7 +20,6 @@
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/ranges_sample.h b/libcxx/include/__algorithm/ranges_sample.h
index a37cb64fa2bf2..917b82adf4185 100644
--- a/libcxx/include/__algorithm/ranges_sample.h
+++ b/libcxx/include/__algorithm/ranges_sample.h
@@ -19,9 +19,9 @@
#include <__random/uniform_random_bit_generator.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/ranges_shuffle.h b/libcxx/include/__algorithm/ranges_shuffle.h
index a2f2c0edded6d..b70237d24c9d2 100644
--- a/libcxx/include/__algorithm/ranges_shuffle.h
+++ b/libcxx/include/__algorithm/ranges_shuffle.h
@@ -23,9 +23,9 @@
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/ranges_stable_partition.h b/libcxx/include/__algorithm/ranges_stable_partition.h
index c3469f17c7d7b..8a8fa86edc60a 100644
--- a/libcxx/include/__algorithm/ranges_stable_partition.h
+++ b/libcxx/include/__algorithm/ranges_stable_partition.h
@@ -26,9 +26,9 @@
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
#include <__ranges/subrange.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/rotate.h b/libcxx/include/__algorithm/rotate.h
index 8934ce095bbc5..7ed6f18628c75 100644
--- a/libcxx/include/__algorithm/rotate.h
+++ b/libcxx/include/__algorithm/rotate.h
@@ -15,9 +15,9 @@
#include <__algorithm/swap_ranges.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_trivially_move_assignable.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#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 f403ba612580c..9c5f75f16ce12 100644
--- a/libcxx/include/__algorithm/sample.h
+++ b/libcxx/include/__algorithm/sample.h
@@ -16,8 +16,8 @@
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__random/uniform_int_distribution.h>
+#include <__type_traits/common_type.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/search.h b/libcxx/include/__algorithm/search.h
index 93771be39e35b..10f0f58da1e23 100644
--- a/libcxx/include/__algorithm/search.h
+++ b/libcxx/include/__algorithm/search.h
@@ -14,12 +14,13 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/advance.h>
#include <__iterator/concepts.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
#include <__type_traits/is_callable.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/search_n.h b/libcxx/include/__algorithm/search_n.h
index 60a073565156e..06962be0dc752 100644
--- a/libcxx/include/__algorithm/search_n.h
+++ b/libcxx/include/__algorithm/search_n.h
@@ -14,14 +14,15 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/advance.h>
#include <__iterator/concepts.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__ranges/concepts.h>
+#include <__type_traits/is_callable.h>
#include <__utility/convert_to_integral.h>
#include <__utility/pair.h>
-#include <type_traits> // __convert_to_integral
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/set_
diff erence.h b/libcxx/include/__algorithm/set_
diff erence.h
index cffdc8fc4fc00..5a7d3bc18c911 100644
--- a/libcxx/include/__algorithm/set_
diff erence.h
+++ b/libcxx/include/__algorithm/set_
diff erence.h
@@ -17,9 +17,9 @@
#include <__functional/identity.h>
#include <__functional/invoke.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/shift_left.h b/libcxx/include/__algorithm/shift_left.h
index 33f06d57e23a4..dde8ecea6e23c 100644
--- a/libcxx/include/__algorithm/shift_left.h
+++ b/libcxx/include/__algorithm/shift_left.h
@@ -12,7 +12,6 @@
#include <__algorithm/move.h>
#include <__config>
#include <__iterator/iterator_traits.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/shift_right.h b/libcxx/include/__algorithm/shift_right.h
index 14bc761598b26..d4eee14d5d3e4 100644
--- a/libcxx/include/__algorithm/shift_right.h
+++ b/libcxx/include/__algorithm/shift_right.h
@@ -15,7 +15,6 @@
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__utility/swap.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/sort_heap.h b/libcxx/include/__algorithm/sort_heap.h
index 8249407b55099..0dc9acced1ae8 100644
--- a/libcxx/include/__algorithm/sort_heap.h
+++ b/libcxx/include/__algorithm/sort_heap.h
@@ -15,8 +15,9 @@
#include <__algorithm/pop_heap.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/stable_partition.h b/libcxx/include/__algorithm/stable_partition.h
index a49de6dbb0ef2..3b68bd3061e6b 100644
--- a/libcxx/include/__algorithm/stable_partition.h
+++ b/libcxx/include/__algorithm/stable_partition.h
@@ -21,7 +21,6 @@
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/stable_sort.h b/libcxx/include/__algorithm/stable_sort.h
index 8e70978ab61cf..e080147df1e02 100644
--- a/libcxx/include/__algorithm/stable_sort.h
+++ b/libcxx/include/__algorithm/stable_sort.h
@@ -19,10 +19,10 @@
#include <__memory/destruct_n.h>
#include <__memory/temporary_buffer.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/is_trivially_copy_assignable.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h b/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
index 1e86074b3dbd0..b631a5d6ea3b7 100644
--- a/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
+++ b/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
@@ -11,7 +11,7 @@
#include <__config>
#include <__functional/invoke.h>
-#include <type_traits>
+#include <__type_traits/remove_cvref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__random/is_valid.h b/libcxx/include/__random/is_valid.h
index 1d65de00fbb6f..113452bc5d35a 100644
--- a/libcxx/include/__random/is_valid.h
+++ b/libcxx/include/__random/is_valid.h
@@ -10,8 +10,12 @@
#define _LIBCPP___RANDOM_IS_VALID_H
#include <__config>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_unsigned.h>
+#include <__utility/declval.h>
#include <cstdint>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__random/log2.h b/libcxx/include/__random/log2.h
index 72bf0759eeac4..4ccd1ddc9bf23 100644
--- a/libcxx/include/__random/log2.h
+++ b/libcxx/include/__random/log2.h
@@ -10,8 +10,8 @@
#define _LIBCPP___RANDOM_LOG2_H
#include <__config>
+#include <__type_traits/conditional.h>
#include <cstddef>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__random/uniform_int_distribution.h b/libcxx/include/__random/uniform_int_distribution.h
index d0e548db2e987..45f910b2f74e2 100644
--- a/libcxx/include/__random/uniform_int_distribution.h
+++ b/libcxx/include/__random/uniform_int_distribution.h
@@ -12,12 +12,13 @@
#include <__config>
#include <__random/is_valid.h>
#include <__random/log2.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/make_unsigned.h>
#include <bit>
#include <cstddef>
#include <cstdint>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__random/uniform_random_bit_generator.h b/libcxx/include/__random/uniform_random_bit_generator.h
index 84a30b0ebe168..f4d1801ca64f9 100644
--- a/libcxx/include/__random/uniform_random_bit_generator.h
+++ b/libcxx/include/__random/uniform_random_bit_generator.h
@@ -13,7 +13,8 @@
#include <__concepts/invocable.h>
#include <__concepts/same_as.h>
#include <__config>
-#include <type_traits>
+#include <__functional/invoke.h>
+#include <__type_traits/integral_constant.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 52d9cc9d16271..0f9767c3663b3 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1719,7 +1719,6 @@ template <class BidirectionalIterator, class Compare>
#include <__config>
#include <__debug>
#include <cstddef>
-#include <type_traits>
#include <version>
#include <__algorithm/adjacent_find.h>
@@ -1933,6 +1932,7 @@ template <class BidirectionalIterator, class Compare>
# include <iterator>
# include <memory>
# include <stdexcept>
+# include <type_traits>
# include <utility>
#endif
diff --git a/libcxx/include/regex b/libcxx/include/regex
index f4fb7a38a6ced..9fffb5fff0d69 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -6869,6 +6869,7 @@ _LIBCPP_POP_MACROS
# include <iosfwd>
# include <iterator>
# include <new>
+# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
diff --git a/libcxx/include/valarray b/libcxx/include/valarray
index 92521ed3819cf..0dbb31ea714d0 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -4935,6 +4935,7 @@ _LIBCPP_POP_MACROS
# include <concepts>
# include <cstring>
# include <functional>
+# include <type_traits>
#endif
#endif // _LIBCPP_VALARRAY
diff --git a/libcxx/test/libcxx/transitive_includes/cxx2b.csv b/libcxx/test/libcxx/transitive_includes/cxx2b.csv
index 9159e57838a89..4781c9d464734 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx2b.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx2b.csv
@@ -8,7 +8,6 @@ algorithm initializer_list
algorithm iosfwd
algorithm limits
algorithm new
-algorithm type_traits
algorithm version
any cstddef
any cstdint
@@ -527,7 +526,6 @@ regex limits
regex mutex
regex stdexcept
regex string
-regex type_traits
regex vector
regex version
scoped_allocator cstddef
@@ -696,7 +694,6 @@ valarray initializer_list
valarray limits
valarray new
valarray stdexcept
-valarray type_traits
valarray version
variant compare
variant cstddef
More information about the libcxx-commits
mailing list