[libcxx-commits] [libcxx] d6cd425 - [libc++] Adds missing includes.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 19 08:35:44 PDT 2023
Author: Mark de Wever
Date: 2023-04-19T17:35:38+02:00
New Revision: d6cd4257e510ef54d2945cb2119e84cc5525438a
URL: https://github.com/llvm/llvm-project/commit/d6cd4257e510ef54d2945cb2119e84cc5525438a
DIFF: https://github.com/llvm/llvm-project/commit/d6cd4257e510ef54d2945cb2119e84cc5525438a.diff
LOG: [libc++] Adds missing includes.
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
Added:
Modified:
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
Removed:
################################################################################
diff --git a/libcxx/include/__format/buffer.h b/libcxx/include/__format/buffer.h
index 0f669ba9e2854..16db88aec7fbe 100644
--- a/libcxx/include/__format/buffer.h
+++ b/libcxx/include/__format/buffer.h
@@ -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>
diff --git a/libcxx/include/__random/seed_seq.h b/libcxx/include/__random/seed_seq.h
index e9a0596b33162..506b979cf8126 100644
--- a/libcxx/include/__random/seed_seq.h
+++ b/libcxx/include/__random/seed_seq.h
@@ -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>
diff --git a/libcxx/test/libcxx/containers/sequences/vector/robust_against_adl.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/robust_against_adl.pass.cpp
index ed991fe2194d8..83f90ac4184bf 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/robust_against_adl.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/robust_against_adl.pass.cpp
@@ -11,6 +11,7 @@
// <vector>
#include <cstddef>
+#include <memory>
#include <vector>
#include "test_macros.h"
diff --git a/libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp
index df3fc1422ebee..928fceab1f078 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp
@@ -13,6 +13,7 @@
#include <cstddef>
#include <type_traits>
+#include <memory>
#include <vector>
#include "count_new.h"
diff --git a/libcxx/test/std/containers/sequences/vector.bool/reference/assign_copy.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/reference/assign_copy.pass.cpp
index bcccb20318ded..7568eb2f3cc3e 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/reference/assign_copy.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/reference/assign_copy.pass.cpp
@@ -12,6 +12,7 @@
#include <cassert>
#include <vector>
+#include <utility>
#include "test_macros.h"
diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.addressof.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.addressof.compile.pass.cpp
index 168a9e804f67a..2008c8d048f4b 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.addressof.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.addressof.compile.pass.cpp
@@ -13,6 +13,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"
diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp
index 3aab782e38af5..7902ed7ca6b88 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp
@@ -14,6 +14,7 @@
// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
+#include <algorithm>
#include <vector>
#include <cassert>
#include <cstddef>
diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp
index 1b7d62ee1583f..aa743ad55152c 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp
@@ -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>
diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp
index 05b29c423ce26..521b8705d4920 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp
@@ -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"
diff --git a/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/ctor.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/ctor.pass.cpp
index d9b14e4820abc..70ab8557fc7c4 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/ctor.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/ctor.pass.cpp
@@ -13,6 +13,7 @@
#include <cassert>
#include <ranges>
#include <type_traits>
+#include <utility>
#include <vector>
struct DefaultConstructibleView : std::ranges::view_base {
diff --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
index 6eb75b93f59c3..6c42df9e1e097 100644
--- a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
+++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
@@ -15,6 +15,7 @@
#include <optional>
#include <type_traits>
+#include <memory>
#include <vector>
#include <cassert>
diff --git a/libcxx/test/support/nasty_containers.h b/libcxx/test/support/nasty_containers.h
index 18a424ba1fdbf..2f4f04d2843f9 100644
--- a/libcxx/test/support/nasty_containers.h
+++ b/libcxx/test/support/nasty_containers.h
@@ -13,6 +13,7 @@
#include <cstddef>
#include <vector>
#include <list>
+#include <type_traits>
#include "test_macros.h"
More information about the libcxx-commits
mailing list