Skip to content

Commit 1458458

Browse files
committed
[libc++] Remove <utility> includes
Reviewed By: ldionne, Quuxplusone, #libc Spies: libcxx-commits, arphaman Differential Revision: https://reviews.llvm.org/D121054
1 parent 14324fa commit 1458458

19 files changed

+3
-36
lines changed

libcxx/docs/ReleaseNotes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ API Changes
5959
``<filesystem>`` header. The associated macro
6060
``_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM`` has also been removed.
6161

62-
- Some libc++ headers no longer transitively include all of ``<algorithm>``and ``<chrono>``.
62+
- Some libc++ headers no longer transitively include all of ``<algorithm>``, ``<chrono>`` and ``<utility>``.
6363
If, after updating libc++, you see compiler errors related to missing declarations in
6464
namespace ``std``, it might be because one of your source files now needs to
65-
``#include <algorithm>`` and/or ``#include <chrono>``.
65+
``#include <algorithm>``, ``#include <chrono>`` and/or ``#include <utility>``.
6666

6767
- The integer distributions ``binomial_distribution``, ``discrete_distribution``,
6868
``geometric_distribution``, ``negative_binomial_distribution``, ``poisson_distribution``,

libcxx/include/__hash_table

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include <memory>
2525
#include <type_traits>
2626

27-
#include <utility> // TODO: Remove this
28-
2927
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
3028
# pragma GCC system_header
3129
#endif

libcxx/include/__locale

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#include <mutex>
2020
#include <string>
2121

22-
#include <utility> // TODO: Remove this
23-
2422
#if defined(_LIBCPP_MSVCRT_LIKE)
2523
# include <__support/win32/locale_win32.h>
2624
# include <cstring>

libcxx/include/algorithm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,8 +733,6 @@ template <class BidirectionalIterator, class Compare>
733733
#include <type_traits>
734734
#include <version>
735735

736-
#include <utility> // TODO: Remove this
737-
738736
#include <__algorithm/adjacent_find.h>
739737
#include <__algorithm/all_of.h>
740738
#include <__algorithm/any_of.h>

libcxx/include/array

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
123123
#include <type_traits>
124124
#include <version>
125125

126-
#include <utility> // TODO: Remove this
127-
128126
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
129127
# pragma GCC system_header
130128
#endif

libcxx/include/experimental/memory_resource

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ namespace pmr {
7777
#include <stdexcept>
7878
#include <type_traits>
7979

80-
#include <utility> // TODO: Remove this
81-
8280
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
8381
# pragma GCC system_header
8482
#endif

libcxx/include/experimental/propagate_const

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@
112112
#include <functional>
113113
#include <type_traits>
114114

115-
#include <utility> // TODO: Remove this
116-
117115
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
118116
# pragma GCC system_header
119117
#endif

libcxx/include/functional

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,6 @@ POLICY: For non-variadic implementations, the number of arguments is limited
527527
#include <typeinfo>
528528
#include <version>
529529

530-
#include <utility> // TODO: Remove this
531-
532530
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
533531
# pragma GCC system_header
534532
#endif

libcxx/include/iterator

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,6 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
656656
#include <type_traits>
657657
#include <version>
658658

659-
#include <utility> // TODO: Remove this
660-
661659
// TODO: remove these headers
662660
#include <__functional/binary_function.h>
663661
#include <__functional/invoke.h>

libcxx/include/map

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,6 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
546546
#include <type_traits>
547547
#include <version>
548548

549-
#include <utility> // TODO: Remove this
550-
551549
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
552550
# pragma GCC system_header
553551
#endif

libcxx/include/memory

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,6 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
835835
#include <typeinfo>
836836
#include <version>
837837

838-
#include <utility> // TODO: Remove this
839-
840838
// TODO: remove these headers
841839
#include <__functional/binary_function.h>
842840
#include <__functional/invoke.h>

libcxx/include/optional

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ template<class T>
172172
#include <type_traits>
173173
#include <version>
174174

175-
#include <utility> // TODO: Remove this
176-
177175
// TODO: remove these headers
178176
#include <__memory/allocator_arg_t.h>
179177
#include <__memory/uses_allocator.h>

libcxx/include/ranges

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ namespace std {
256256
#include <__ranges/transform_view.h>
257257
#include <__ranges/view_interface.h>
258258
#include <__ranges/views.h>
259+
#include <__tuple> // TODO: <ranges> has to export std::tuple_size. Replace this, once <tuple> is granularized.
259260
#include <compare> // Required by the standard.
260261
#include <initializer_list> // Required by the standard.
261262
#include <iterator> // Required by the standard.

libcxx/include/regex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
779779
#include <vector>
780780
#include <version>
781781

782-
#include <utility> // TODO: Remove this
783-
784782
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
785783
# pragma GCC system_header
786784
#endif

libcxx/include/string

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
543543
#include <type_traits>
544544
#include <version>
545545

546-
#include <utility> // TODO: Remove this
547-
548546
// TODO: remove these headers
549547
#include <__functional/binary_function.h>
550548
#include <__functional/invoke.h>

libcxx/include/tuple

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ template <class... Types>
183183
#include <type_traits>
184184
#include <version>
185185

186-
#include <utility> // TODO: Remove this
187-
188186
// TODO: remove these headers
189187
#include <__functional/binary_function.h>
190188
#include <__functional/invoke.h>

libcxx/include/typeindex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ struct hash<type_index>
5050
#include <typeinfo>
5151
#include <version>
5252

53-
#include <utility> // TODO: Remove this
54-
5553
// TODO: remove these headers
5654
#include <__functional/binary_function.h>
5755
#include <__functional/invoke.h>

libcxx/include/variant

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ namespace std {
219219
#include <type_traits>
220220
#include <version>
221221

222-
#include <utility> // TODO: Remove this
223-
224222
// TODO: remove these headers
225223
#include <__functional/binary_function.h>
226224
#include <__functional/invoke.h>

libcxx/include/vector

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,6 @@ erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
302302
#include <type_traits>
303303
#include <version>
304304

305-
#include <utility> // TODO: Remove this
306-
307305
// TODO: remove these headers
308306
#include <__functional/binary_function.h>
309307
#include <__functional/invoke.h>

0 commit comments

Comments
 (0)