[libcxx-commits] [libcxx] 1458458 - [libc++] Remove <utility> includes
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 16 16:12:41 PDT 2022
Author: Nikolas Klauser
Date: 2022-03-17T00:12:33+01:00
New Revision: 1458458b558d3cbce5a8b1845ed43bbe141db2fd
URL: https://github.com/llvm/llvm-project/commit/1458458b558d3cbce5a8b1845ed43bbe141db2fd
DIFF: https://github.com/llvm/llvm-project/commit/1458458b558d3cbce5a8b1845ed43bbe141db2fd.diff
LOG: [libc++] Remove <utility> includes
Reviewed By: ldionne, Quuxplusone, #libc
Spies: libcxx-commits, arphaman
Differential Revision: https://reviews.llvm.org/D121054
Added:
Modified:
libcxx/docs/ReleaseNotes.rst
libcxx/include/__hash_table
libcxx/include/__locale
libcxx/include/algorithm
libcxx/include/array
libcxx/include/experimental/memory_resource
libcxx/include/experimental/propagate_const
libcxx/include/functional
libcxx/include/iterator
libcxx/include/map
libcxx/include/memory
libcxx/include/optional
libcxx/include/ranges
libcxx/include/regex
libcxx/include/string
libcxx/include/tuple
libcxx/include/typeindex
libcxx/include/variant
libcxx/include/vector
Removed:
################################################################################
diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index bc3251e5b42d4..ee1cc816e12eb 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -59,10 +59,10 @@ API Changes
``<filesystem>`` header. The associated macro
``_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM`` has also been removed.
-- Some libc++ headers no longer transitively include all of ``<algorithm>``and ``<chrono>``.
+- Some libc++ headers no longer transitively include all of ``<algorithm>``, ``<chrono>`` and ``<utility>``.
If, after updating libc++, you see compiler errors related to missing declarations in
namespace ``std``, it might be because one of your source files now needs to
- ``#include <algorithm>`` and/or ``#include <chrono>``.
+ ``#include <algorithm>``, ``#include <chrono>`` and/or ``#include <utility>``.
- The integer distributions ``binomial_distribution``, ``discrete_distribution``,
``geometric_distribution``, ``negative_binomial_distribution``, ``poisson_distribution``,
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index eae111bf6043c..d53132437767f 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -24,8 +24,6 @@
#include <memory>
#include <type_traits>
-#include <utility> // TODO: Remove this
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index a31112d3da29e..9fd707c7651ca 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -19,8 +19,6 @@
#include <mutex>
#include <string>
-#include <utility> // TODO: Remove this
-
#if defined(_LIBCPP_MSVCRT_LIKE)
# include <__support/win32/locale_win32.h>
# include <cstring>
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 6fe66e425ef73..8383b40f20ef9 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -733,8 +733,6 @@ template <class BidirectionalIterator, class Compare>
#include <type_traits>
#include <version>
-#include <utility> // TODO: Remove this
-
#include <__algorithm/adjacent_find.h>
#include <__algorithm/all_of.h>
#include <__algorithm/any_of.h>
diff --git a/libcxx/include/array b/libcxx/include/array
index ce419210667d7..0b366080eefca 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -123,8 +123,6 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
#include <type_traits>
#include <version>
-#include <utility> // TODO: Remove this
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource
index 359ac70be014d..16c7d8de66c54 100644
--- a/libcxx/include/experimental/memory_resource
+++ b/libcxx/include/experimental/memory_resource
@@ -77,8 +77,6 @@ namespace pmr {
#include <stdexcept>
#include <type_traits>
-#include <utility> // TODO: Remove this
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const
index b6c3827871ae0..e6224225e3b16 100644
--- a/libcxx/include/experimental/propagate_const
+++ b/libcxx/include/experimental/propagate_const
@@ -112,8 +112,6 @@
#include <functional>
#include <type_traits>
-#include <utility> // TODO: Remove this
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/functional b/libcxx/include/functional
index 09f6ec52235af..d097861a9011d 100644
--- a/libcxx/include/functional
+++ b/libcxx/include/functional
@@ -527,8 +527,6 @@ POLICY: For non-variadic implementations, the number of arguments is limited
#include <typeinfo>
#include <version>
-#include <utility> // TODO: Remove this
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index 312939599d29f..852fa353a9c2a 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -656,8 +656,6 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#include <type_traits>
#include <version>
-#include <utility> // TODO: Remove this
-
// TODO: remove these headers
#include <__functional/binary_function.h>
#include <__functional/invoke.h>
diff --git a/libcxx/include/map b/libcxx/include/map
index 4aae8dbc1b4b1..2266e1abe9e5b 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -546,8 +546,6 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
#include <type_traits>
#include <version>
-#include <utility> // TODO: Remove this
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/memory b/libcxx/include/memory
index 1fccdacdcf862..1991e29228d16 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -835,8 +835,6 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
#include <typeinfo>
#include <version>
-#include <utility> // TODO: Remove this
-
// TODO: remove these headers
#include <__functional/binary_function.h>
#include <__functional/invoke.h>
diff --git a/libcxx/include/optional b/libcxx/include/optional
index effee3018ab39..22b0cf16cdc7f 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -172,8 +172,6 @@ template<class T>
#include <type_traits>
#include <version>
-#include <utility> // TODO: Remove this
-
// TODO: remove these headers
#include <__memory/allocator_arg_t.h>
#include <__memory/uses_allocator.h>
diff --git a/libcxx/include/ranges b/libcxx/include/ranges
index 25ed65ba1ed3e..b6c028d2219b6 100644
--- a/libcxx/include/ranges
+++ b/libcxx/include/ranges
@@ -256,6 +256,7 @@ namespace std {
#include <__ranges/transform_view.h>
#include <__ranges/view_interface.h>
#include <__ranges/views.h>
+#include <__tuple> // TODO: <ranges> has to export std::tuple_size. Replace this, once <tuple> is granularized.
#include <compare> // Required by the standard.
#include <initializer_list> // Required by the standard.
#include <iterator> // Required by the standard.
diff --git a/libcxx/include/regex b/libcxx/include/regex
index 56d92f2d51be3..661a08b7c30c7 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -779,8 +779,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#include <vector>
#include <version>
-#include <utility> // TODO: Remove this
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/string b/libcxx/include/string
index 1d0b7831cd657..c79c0ed72abd8 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -543,8 +543,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
#include <type_traits>
#include <version>
-#include <utility> // TODO: Remove this
-
// TODO: remove these headers
#include <__functional/binary_function.h>
#include <__functional/invoke.h>
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index e1303f9c8b127..ea7245d7aa88a 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -183,8 +183,6 @@ template <class... Types>
#include <type_traits>
#include <version>
-#include <utility> // TODO: Remove this
-
// TODO: remove these headers
#include <__functional/binary_function.h>
#include <__functional/invoke.h>
diff --git a/libcxx/include/typeindex b/libcxx/include/typeindex
index 592da67b1b82d..f0680398e9a15 100644
--- a/libcxx/include/typeindex
+++ b/libcxx/include/typeindex
@@ -50,8 +50,6 @@ struct hash<type_index>
#include <typeinfo>
#include <version>
-#include <utility> // TODO: Remove this
-
// TODO: remove these headers
#include <__functional/binary_function.h>
#include <__functional/invoke.h>
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 2eb93ba9525c5..15c4367404ff7 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -219,8 +219,6 @@ namespace std {
#include <type_traits>
#include <version>
-#include <utility> // TODO: Remove this
-
// TODO: remove these headers
#include <__functional/binary_function.h>
#include <__functional/invoke.h>
diff --git a/libcxx/include/vector b/libcxx/include/vector
index b5bafbe18bca7..97a8524987445 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -302,8 +302,6 @@ erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
#include <type_traits>
#include <version>
-#include <utility> // TODO: Remove this
-
// TODO: remove these headers
#include <__functional/binary_function.h>
#include <__functional/invoke.h>
More information about the libcxx-commits
mailing list