[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
This commit is contained in:
Mark de Wever 2022-06-12 11:55:47 +02:00
parent 26465c8337
commit c36870c8e7
10 changed files with 5 additions and 34 deletions

View File

@ -97,7 +97,10 @@ API Changes
- 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

View File

@ -723,13 +723,6 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#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

View File

@ -178,11 +178,6 @@ template<class T>
#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

View File

@ -553,10 +553,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
#include <type_traits>
#include <version>
// TODO: remove these headers
#include <new>
#include <typeinfo>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# include <cwchar>
#endif

View File

@ -184,11 +184,6 @@ template <class... Types>
#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

View File

@ -51,11 +51,6 @@ struct hash<type_index>
#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

View File

@ -220,11 +220,6 @@ namespace std {
#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

View File

@ -307,9 +307,6 @@ erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
#include <type_traits>
#include <version>
// TODO: remove these headers
#include <typeinfo>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

View File

@ -10,6 +10,7 @@
#define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_JOIN_TYPES_H
#include <concepts>
#include <cstdint>
#include <tuple>
#include "test_macros.h"

View File

@ -18,6 +18,7 @@
#include <numeric>
#include <tuple>
#include <cassert>
#include <cstdint>
#include "test_macros.h"