[libc++] Removes unneeded includes.
This removes all "TODO: remove these headers" comments from our headers.
Note there seem to be more headers that can be removed, that will be
done in separate commits.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D127592
NOKEYCHECK=True
GitOrigin-RevId: c36870c8e79c1690432076c69cb98a879555efa8
diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst
index 8c77f2e..362e0ce 100644
--- a/docs/ReleaseNotes.rst
+++ b/docs/ReleaseNotes.rst
@@ -97,7 +97,10 @@
- Some libc++ headers no longer transitively include all of:
- ``<algorithm>``
- ``<chrono>``
+ - ``<exception>``
- ``<functional>``
+ - ``<new>``
+ - ``<typeinfo>``
- ``<utility>``
If, after updating libc++, you see compiler errors related to missing declarations
diff --git a/include/iterator b/include/iterator
index 30c9a10..f0bcff9 100644
--- a/include/iterator
+++ b/include/iterator
@@ -723,13 +723,6 @@
#include <type_traits>
#include <version>
-// TODO: remove these headers
-#include <__memory/allocator_arg_t.h>
-#include <__memory/uses_allocator.h>
-#include <exception>
-#include <new>
-#include <typeinfo>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/include/optional b/include/optional
index b1e014e..ec01af4 100644
--- a/include/optional
+++ b/include/optional
@@ -178,11 +178,6 @@
#include <type_traits>
#include <version>
-// TODO: remove these headers
-#include <__memory/allocator_arg_t.h>
-#include <__memory/uses_allocator.h>
-#include <typeinfo>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/include/string b/include/string
index 7229a56..9cfbb5f 100644
--- a/include/string
+++ b/include/string
@@ -553,10 +553,6 @@
#include <type_traits>
#include <version>
-// TODO: remove these headers
-#include <new>
-#include <typeinfo>
-
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# include <cwchar>
#endif
diff --git a/include/tuple b/include/tuple
index cc08d8c..8c5b24e 100644
--- a/include/tuple
+++ b/include/tuple
@@ -184,11 +184,6 @@
#include <type_traits>
#include <version>
-// TODO: remove these headers
-#include <exception>
-#include <new>
-#include <typeinfo>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/include/typeindex b/include/typeindex
index 8da8f58..a92375a 100644
--- a/include/typeindex
+++ b/include/typeindex
@@ -51,11 +51,6 @@
#include <typeinfo>
#include <version>
-// TODO: remove these headers
-#include <__memory/allocator_arg_t.h>
-#include <__memory/uses_allocator.h>
-#include <new>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/include/variant b/include/variant
index 16fcede..f15d600 100644
--- a/include/variant
+++ b/include/variant
@@ -220,11 +220,6 @@
#include <type_traits>
#include <version>
-// TODO: remove these headers
-#include <__memory/allocator_arg_t.h>
-#include <__memory/uses_allocator.h>
-#include <typeinfo>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/include/vector b/include/vector
index f3710ea..73806b9 100644
--- a/include/vector
+++ b/include/vector
@@ -307,9 +307,6 @@
#include <type_traits>
#include <version>
-// TODO: remove these headers
-#include <typeinfo>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/test/std/ranges/range.adaptors/range.join.view/types.h b/test/std/ranges/range.adaptors/range.join.view/types.h
index 4dd3cf7..6cc7d8c 100644
--- a/test/std/ranges/range.adaptors/range.join.view/types.h
+++ b/test/std/ranges/range.adaptors/range.join.view/types.h
@@ -10,6 +10,7 @@
#define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_JOIN_TYPES_H
#include <concepts>
+#include <cstdint>
#include <tuple>
#include "test_macros.h"
diff --git a/test/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp b/test/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp
index b8606fb..1efa3d9 100644
--- a/test/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp
+++ b/test/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp
@@ -18,6 +18,7 @@
#include <numeric>
#include <tuple>
#include <cassert>
+#include <cstdint>
#include "test_macros.h"