[libcxx-commits] [libcxx] 52915d7 - [libc++] Granularize <utility> includes

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 5 10:31:52 PST 2022


Author: Nikolas Klauser
Date: 2022-03-05T19:31:46+01:00
New Revision: 52915d78f44bfc5add6cddc91d392fa343672897

URL: https://github.com/llvm/llvm-project/commit/52915d78f44bfc5add6cddc91d392fa343672897
DIFF: https://github.com/llvm/llvm-project/commit/52915d78f44bfc5add6cddc91d392fa343672897.diff

LOG: [libc++] Granularize <utility> includes

Reviewed By: ldionne, #libc

Spies: EricWF, libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D120466

Added: 
    

Modified: 
    libcxx/include/__algorithm/rotate.h
    libcxx/include/__format/formatter.h
    libcxx/include/__functional/function.h
    libcxx/include/__hash_table
    libcxx/include/__locale
    libcxx/include/__memory/shared_ptr.h
    libcxx/include/__tree
    libcxx/include/algorithm
    libcxx/include/any
    libcxx/include/array
    libcxx/include/deque
    libcxx/include/experimental/memory_resource
    libcxx/include/experimental/propagate_const
    libcxx/include/fstream
    libcxx/include/functional
    libcxx/include/future
    libcxx/include/ios
    libcxx/include/iterator
    libcxx/include/list
    libcxx/include/map
    libcxx/include/memory
    libcxx/include/optional
    libcxx/include/regex
    libcxx/include/sstream
    libcxx/include/string
    libcxx/include/tuple
    libcxx/include/typeindex
    libcxx/include/variant
    libcxx/include/vector
    libcxx/test/libcxx/ranges/range.access/end.incomplete_type.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/begin.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/assign.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/ctor.in_place.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/ctor.value.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/structured_bindings.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__algorithm/rotate.h b/libcxx/include/__algorithm/rotate.h
index 344c2f8cc9ff9..ec7b999c5b1a1 100644
--- a/libcxx/include/__algorithm/rotate.h
+++ b/libcxx/include/__algorithm/rotate.h
@@ -16,6 +16,7 @@
 #include <__iterator/iterator_traits.h>
 #include <__iterator/next.h>
 #include <__iterator/prev.h>
+#include <__utility/move.h>
 #include <__utility/swap.h>
 #include <iterator>
 

diff  --git a/libcxx/include/__format/formatter.h b/libcxx/include/__format/formatter.h
index f9e0b6c84b7b7..44769c5faadb5 100644
--- a/libcxx/include/__format/formatter.h
+++ b/libcxx/include/__format/formatter.h
@@ -20,6 +20,7 @@
 #include <__format/format_fwd.h>
 #include <__format/format_string.h>
 #include <__format/parser_std_format_spec.h>
+#include <__utility/move.h>
 #include <__utility/unreachable.h>
 #include <string_view>
 

diff  --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index 4698c8c2d42e0..5e734d0af350c 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -22,6 +22,7 @@
 #include <__memory/shared_ptr.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <__utility/swap.h>
 #include <exception>
 #include <memory> // TODO: replace with <__memory/__builtin_new_allocator.h>
 #include <type_traits>

diff  --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index 5de00a3abcb5b..eae111bf6043c 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -17,12 +17,14 @@
 #include <__config>
 #include <__debug>
 #include <__functional/hash.h>
+#include <__utility/swap.h>
 #include <cmath>
 #include <initializer_list>
 #include <iterator>
 #include <memory>
 #include <type_traits>
-#include <utility>
+
+#include <utility> // TODO: Remove this
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__locale b/libcxx/include/__locale
index e1781986fd35a..a31112d3da29e 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -18,7 +18,8 @@
 #include <memory>
 #include <mutex>
 #include <string>
-#include <utility>
+
+#include <utility> // TODO: Remove this
 
 #if defined(_LIBCPP_MSVCRT_LIKE)
 # include <__support/win32/locale_win32.h>

diff  --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index 0f28bcdfac11b..7401d3a891c1d 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -24,6 +24,7 @@
 #include <__memory/unique_ptr.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
+#include <__utility/swap.h>
 #include <cstddef>
 #include <cstdlib> // abort
 #include <iosfwd>

diff  --git a/libcxx/include/__tree b/libcxx/include/__tree
index 384d3835049bb..f8d2226e66fbb 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -13,6 +13,7 @@
 #include <__algorithm/min.h>
 #include <__config>
 #include <__utility/forward.h>
+#include <__utility/swap.h>
 #include <iterator>
 #include <limits>
 #include <memory>

diff  --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 06314bdc66fb0..8bff2069c4308 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -692,9 +692,10 @@ template <class BidirectionalIterator, class Compare>
 #include <iterator>
 #include <memory>
 #include <type_traits>
-#include <utility>
 #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/any b/libcxx/include/any
index 2a85a66c2959c..7dc50b78df8c5 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -83,6 +83,8 @@ namespace std {
 #include <__availability>
 #include <__config>
 #include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/move.h>
 #include <cstdlib>
 #include <memory>
 #include <type_traits>

diff  --git a/libcxx/include/array b/libcxx/include/array
index 314d24935a431..ce419210667d7 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -115,13 +115,16 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
 #include <__assert>
 #include <__config>
 #include <__tuple>
+#include <__utility/integer_sequence.h>
+#include <__utility/move.h>
 #include <__utility/unreachable.h>
 #include <iterator>
 #include <stdexcept>
 #include <type_traits>
-#include <utility>
 #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/deque b/libcxx/include/deque
index a6f2a676f3b48..537a8ddcb5ea1 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -174,6 +174,8 @@ template <class T, class Allocator, class Predicate>
 #include <__iterator/iterator_traits.h>
 #include <__split_buffer>
 #include <__utility/forward.h>
+#include <__utility/move.h>
+#include <__utility/swap.h>
 #include <compare>
 #include <initializer_list>
 #include <iterator>

diff  --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource
index 098e25f1261f5..359ac70be014d 100644
--- a/libcxx/include/experimental/memory_resource
+++ b/libcxx/include/experimental/memory_resource
@@ -66,6 +66,7 @@ namespace pmr {
 
 #include <__assert>
 #include <__tuple>
+#include <__utility/move.h>
 #include <cstddef>
 #include <cstdlib>
 #include <experimental/__config>
@@ -75,7 +76,8 @@ namespace pmr {
 #include <new>
 #include <stdexcept>
 #include <type_traits>
-#include <utility>
+
+#include <utility> // TODO: Remove this
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const
index c2774b19d3b01..b6c3827871ae0 100644
--- a/libcxx/include/experimental/propagate_const
+++ b/libcxx/include/experimental/propagate_const
@@ -106,10 +106,13 @@
 
 */
 
+#include <__utility/move.h>
+#include <__utility/swap.h>
 #include <experimental/__config>
 #include <functional>
 #include <type_traits>
-#include <utility>
+
+#include <utility> // TODO: Remove this
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/fstream b/libcxx/include/fstream
index 80bda63755c64..2f1cd32b35fb1 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -184,9 +184,12 @@ typedef basic_fstream<wchar_t> wfstream;
 #include <__availability>
 #include <__config>
 #include <__locale>
+#include <__utility/move.h>
+#include <__utility/swap.h>
 #include <__utility/unreachable.h>
 #include <cstdio>
 #include <cstdlib>
+#include <cstring>
 #include <istream>
 #include <ostream>
 #include <version>

diff  --git a/libcxx/include/functional b/libcxx/include/functional
index d4889294f7c9a..09f6ec52235af 100644
--- a/libcxx/include/functional
+++ b/libcxx/include/functional
@@ -525,9 +525,10 @@ POLICY:  For non-variadic implementations, the number of arguments is limited
 #include <tuple>
 #include <type_traits>
 #include <typeinfo>
-#include <utility>
 #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/future b/libcxx/include/future
index a4c8ccc6d61e0..162d400136027 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -370,6 +370,7 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
 #include <__memory/uses_allocator.h>
 #include <__utility/auto_cast.h>
 #include <__utility/forward.h>
+#include <__utility/move.h>
 #include <exception>
 #include <memory>
 #include <mutex>

diff  --git a/libcxx/include/ios b/libcxx/include/ios
index 874227ac73ef7..15053e524682a 100644
--- a/libcxx/include/ios
+++ b/libcxx/include/ios
@@ -213,6 +213,7 @@ storage-class-specifier const error_category& iostream_category() noexcept;
 #include <__config>
 #include <__ios/fpos.h>
 #include <__locale>
+#include <__utility/swap.h>
 #include <iosfwd>
 #include <system_error>
 #include <version>

diff  --git a/libcxx/include/iterator b/libcxx/include/iterator
index 6e2eb4a78c287..312939599d29f 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -654,9 +654,10 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
 #include <cstddef>
 #include <initializer_list>
 #include <type_traits>
-#include <utility>
 #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/list b/libcxx/include/list
index ac2e466e95c2d..5f32b13608f55 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -188,6 +188,8 @@ template <class T, class Allocator, class Predicate>
 #include <__config>
 #include <__debug>
 #include <__utility/forward.h>
+#include <__utility/move.h>
+#include <__utility/swap.h>
 #include <initializer_list>
 #include <iterator>
 #include <limits>

diff  --git a/libcxx/include/map b/libcxx/include/map
index 551edc58cc221..4aae8dbc1b4b1 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -537,15 +537,17 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <__node_handle>
 #include <__tree>
 #include <__utility/forward.h>
+#include <__utility/swap.h>
 #include <compare>
 #include <functional>
 #include <initializer_list>
 #include <iterator> // __libcpp_erase_if_container
 #include <memory>
 #include <type_traits>
-#include <utility>
 #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 3bc31d29ed6c5..1fccdacdcf862 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -833,9 +833,10 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
 #include <tuple>
 #include <type_traits>
 #include <typeinfo>
-#include <utility>
 #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 b20081d0e1b99..effee3018ab39 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -162,15 +162,18 @@ template<class T>
 #include <__availability>
 #include <__concepts/invocable.h>
 #include <__config>
+#include <__utility/in_place.h>
+#include <__utility/swap.h>
 #include <compare>
 #include <functional>
 #include <initializer_list>
 #include <new>
 #include <stdexcept>
 #include <type_traits>
-#include <utility>
 #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/regex b/libcxx/include/regex
index 68922f66e4c2b..944fa4a900933 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -767,6 +767,8 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
 #include <__config>
 #include <__iterator/wrap_iter.h>
 #include <__locale>
+#include <__utility/move.h>
+#include <__utility/swap.h>
 #include <compare>
 #include <deque>
 #include <initializer_list>
@@ -774,10 +776,11 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
 #include <memory>
 #include <stdexcept>
 #include <string>
-#include <utility>
 #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/sstream b/libcxx/include/sstream
index dd1d9c3d0c1a7..ba6148be8bd55 100644
--- a/libcxx/include/sstream
+++ b/libcxx/include/sstream
@@ -181,6 +181,7 @@ typedef basic_stringstream<wchar_t> wstringstream;
 */
 
 #include <__config>
+#include <__utility/swap.h>
 #include <istream>
 #include <ostream>
 #include <string>

diff  --git a/libcxx/include/string b/libcxx/include/string
index 39647ff79db33..7eadde7e1977e 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -527,6 +527,9 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
 #include <__debug>
 #include <__ios/fpos.h>
 #include <__iterator/wrap_iter.h>
+#include <__utility/auto_cast.h>
+#include <__utility/move.h>
+#include <__utility/swap.h>
 #include <compare>
 #include <cstdio>  // EOF
 #include <cstdlib>
@@ -538,9 +541,10 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
 #include <stdexcept>
 #include <string_view>
 #include <type_traits>
-#include <utility>
 #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 08ded9c916eb5..da5b8d4033864 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -175,12 +175,16 @@ template <class... Types>
 #include <__utility/forward.h>
 #include <__utility/integer_sequence.h>
 #include <__utility/move.h>
+#include <__utility/pair.h>
+#include <__utility/piecewise_construct.h>
+#include <__utility/swap.h>
 #include <compare>
 #include <cstddef>
 #include <type_traits>
-#include <utility>
 #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 b5dcd8496ae02..592da67b1b82d 100644
--- a/libcxx/include/typeindex
+++ b/libcxx/include/typeindex
@@ -50,6 +50,8 @@ 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>
@@ -59,7 +61,6 @@ struct hash<type_index>
 #include <__memory/allocator_arg_t.h>
 #include <__memory/uses_allocator.h>
 #include <new>
-#include <utility>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/variant b/libcxx/include/variant
index d102196f60a21..6128f2b5e249a 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -206,6 +206,9 @@ namespace std {
 #include <__functional/unary_function.h>
 #include <__tuple>
 #include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/move.h>
+#include <__utility/swap.h>
 #include <__variant/monostate.h>
 #include <compare>
 #include <exception>
@@ -214,9 +217,10 @@ namespace std {
 #include <new>
 #include <tuple>
 #include <type_traits>
-#include <utility>
 #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 57d35064508e6..2170ae6a21173 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -288,6 +288,8 @@ erase_if(vector<T, Allocator>& c, Predicate pred);    // C++20
 #include <__iterator/wrap_iter.h>
 #include <__split_buffer>
 #include <__utility/forward.h>
+#include <__utility/move.h>
+#include <__utility/swap.h>
 #include <climits>
 #include <compare>
 #include <cstdlib>
@@ -300,6 +302,8 @@ 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>
@@ -308,7 +312,6 @@ erase_if(vector<T, Allocator>& c, Predicate pred);    // C++20
 #include <__functional/unary_function.h>
 #include <__functional/weak_result_type.h>
 #include <typeinfo>
-#include <utility>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/test/libcxx/ranges/range.access/end.incomplete_type.pass.cpp b/libcxx/test/libcxx/ranges/range.access/end.incomplete_type.pass.cpp
index c038fa78aa4e7..8deaff34977e3 100644
--- a/libcxx/test/libcxx/ranges/range.access/end.incomplete_type.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.access/end.incomplete_type.pass.cpp
@@ -12,9 +12,10 @@
 // Test the libc++-specific behavior that we handle the IFNDR case for ranges::end
 // by being SFINAE-friendly.
 
-#include <ranges>
 #include <cassert>
+#include <ranges>
 #include <type_traits>
+#include <utility>
 
 struct Incomplete;
 

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp
index 98e9887fa73d9..c657738388f41 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp
@@ -13,9 +13,10 @@
 // template<class R>
 //   drop_view(R&&, range_
diff erence_t<R>) -> drop_view<views::all_t<R>>;
 
-#include <ranges>
 #include <cassert>
 #include <concepts>
+#include <ranges>
+#include <utility>
 
 struct View : std::ranges::view_base {
   int *begin() const;

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp
index f0dd9abc33723..8edd40cc22469 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp
@@ -14,6 +14,7 @@
 //   explicit join_view(R&&) -> join_view<views::all_t<R>>;
 
 #include <ranges>
+#include <utility>
 
 struct Child {
   int *begin() const;

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.take/ctad.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/ctad.compile.pass.cpp
index 419fad396caaa..f765502d4ebb5 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/ctad.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/ctad.compile.pass.cpp
@@ -13,9 +13,10 @@
 // template<class R>
 //   take_view(R&&, range_
diff erence_t<R>) -> take_view<views::all_t<R>>;
 
-#include <ranges>
 #include <cassert>
 #include <concepts>
+#include <ranges>
+#include <utility>
 
 struct View : std::ranges::view_base {
   int *begin() const;

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.transform/ctad.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/ctad.compile.pass.cpp
index 086dc2fb471ae..8f4a9db143e88 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/ctad.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/ctad.compile.pass.cpp
@@ -13,9 +13,10 @@
 // template<class R, class F>
 //   transform_view(R&&, F) -> transform_view<views::all_t<R>, F>;
 
-#include <ranges>
 #include <cassert>
 #include <concepts>
+#include <ranges>
+#include <utility>
 
 struct PlusOne {
     int operator()(int x) const;

diff  --git a/libcxx/test/std/ranges/range.factories/range.iota.view/begin.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/begin.pass.cpp
index 16b80b19ef3b3..e5f31b223a9d5 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/begin.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/begin.pass.cpp
@@ -12,8 +12,9 @@
 
 // constexpr iterator begin() const;
 
-#include <ranges>
 #include <cassert>
+#include <ranges>
+#include <utility>
 
 #include "test_macros.h"
 #include "types.h"

diff  --git a/libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp
index dfbc588b2e0cd..8d32450026d88 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp
@@ -21,8 +21,9 @@
 // constexpr auto end() const;
 // constexpr iterator end() const requires same_as<W, Bound>;
 
-#include <ranges>
 #include <cassert>
+#include <ranges>
+#include <utility>
 
 #include "types.h"
 

diff  --git a/libcxx/test/std/ranges/range.factories/range.single.view/assign.pass.cpp b/libcxx/test/std/ranges/range.factories/range.single.view/assign.pass.cpp
index a94989dda4245..1f855bbceec6b 100644
--- a/libcxx/test/std/ranges/range.factories/range.single.view/assign.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.single.view/assign.pass.cpp
@@ -13,8 +13,9 @@
 
 // Tests that <value_> is a <copyable-box>.
 
-#include <ranges>
 #include <cassert>
+#include <ranges>
+#include <utility>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/ranges/range.factories/range.single.view/ctor.in_place.pass.cpp b/libcxx/test/std/ranges/range.factories/range.single.view/ctor.in_place.pass.cpp
index e2627c1a86822..e0f7371cf8c1c 100644
--- a/libcxx/test/std/ranges/range.factories/range.single.view/ctor.in_place.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.single.view/ctor.in_place.pass.cpp
@@ -14,8 +14,9 @@
 //   requires constructible_from<T, Args...>
 // constexpr explicit single_view(in_place_t, Args&&... args);
 
-#include <ranges>
 #include <cassert>
+#include <ranges>
+#include <utility>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/ranges/range.factories/range.single.view/ctor.value.pass.cpp b/libcxx/test/std/ranges/range.factories/range.single.view/ctor.value.pass.cpp
index da4e86b8c12f4..0a0800265e8bd 100644
--- a/libcxx/test/std/ranges/range.factories/range.single.view/ctor.value.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.single.view/ctor.value.pass.cpp
@@ -13,8 +13,9 @@
 // constexpr explicit single_view(const T& t);
 // constexpr explicit single_view(T&& t);
 
-#include <ranges>
 #include <cassert>
+#include <ranges>
+#include <utility>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/ranges/range.utility/range.subrange/structured_bindings.pass.cpp b/libcxx/test/std/ranges/range.utility/range.subrange/structured_bindings.pass.cpp
index ed2a166b93eca..b22d9b22a52b5 100644
--- a/libcxx/test/std/ranges/range.utility/range.subrange/structured_bindings.pass.cpp
+++ b/libcxx/test/std/ranges/range.utility/range.subrange/structured_bindings.pass.cpp
@@ -12,9 +12,10 @@
 
 // class std::ranges::subrange;
 
+#include <cassert>
 #include <ranges>
+#include <utility>
 
-#include <cassert>
 #include "test_macros.h"
 
 constexpr void test_sized_subrange()

diff  --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp
index 2354bb51560e5..14c400cdd1526 100644
--- a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp
+++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp
@@ -12,10 +12,11 @@
 // template <class U>
 //   optional(optional<U>&& rhs);
 
+#include <cassert>
+#include <memory>
 #include <optional>
 #include <type_traits>
-#include <memory>
-#include <cassert>
+#include <utility>
 
 #include "test_macros.h"
 


        


More information about the libcxx-commits mailing list