[libc++] Adds missing includes.
authorMark de Wever <koraq@xs4all.nl>
Tue, 18 Apr 2023 17:19:48 +0000 (19:19 +0200)
committerMark de Wever <koraq@xs4all.nl>
Wed, 19 Apr 2023 15:35:38 +0000 (17:35 +0200)
This patch makes are code less dependant on transitive includes.

This was part of D145800. This patch will be abandoned, but these
changes are still useful. I manually verified declarations of the new
includes are used in these files.

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D148645

12 files changed:
libcxx/include/__format/buffer.h
libcxx/include/__random/seed_seq.h
libcxx/test/libcxx/containers/sequences/vector/robust_against_adl.pass.cpp
libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp
libcxx/test/std/containers/sequences/vector.bool/reference/assign_copy.pass.cpp
libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.addressof.compile.pass.cpp
libcxx/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp
libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.as.rvalue/ctor.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
libcxx/test/support/nasty_containers.h

index 0f669ba..16db88a 100644 (file)
@@ -29,6 +29,7 @@
 #include <__iterator/wrap_iter.h>
 #include <__memory/addressof.h>
 #include <__type_traits/add_pointer.h>
+#include <__type_traits/conditional.h>
 #include <__utility/move.h>
 #include <cstddef>
 #include <string_view>
index e9a0596..506b979 100644 (file)
@@ -13,6 +13,7 @@
 #include <__algorithm/fill.h>
 #include <__algorithm/max.h>
 #include <__config>
+#include <__iterator/iterator_traits.h>
 #include <cstdint>
 #include <initializer_list>
 #include <vector>
index 3aab782..7902ed7 100644 (file)
@@ -14,6 +14,7 @@
 //    -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
+#include <algorithm>
 #include <vector>
 #include <cassert>
 #include <cstddef>
index 1b7d62e..aa743ad 100644 (file)
@@ -12,6 +12,7 @@
 // Check that vector constructors don't leak memory when an operation inside the constructor throws an exception
 
 #include <cstddef>
+#include <memory>
 #include <type_traits>
 #include <vector>
 
index 05b29c4..521b870 100644 (file)
@@ -15,6 +15,7 @@
 // Validate whether the container can be copy-assigned with an ADL-hijacking operator&
 
 #include <vector>
+#include <utility>
 
 #include "test_macros.h"
 #include "operator_hijacker.h"
index d9b14e4..70ab855 100644 (file)
@@ -13,6 +13,7 @@
 #include <cassert>
 #include <ranges>
 #include <type_traits>
+#include <utility>
 #include <vector>
 
 struct DefaultConstructibleView : std::ranges::view_base {
index 18a424b..2f4f04d 100644 (file)
@@ -13,6 +13,7 @@
 #include <cstddef>
 #include <vector>
 #include <list>
+#include <type_traits>
 
 #include "test_macros.h"