diff mbox series

libstdc++: Reduce header dependencies from PSTL headers [PR92546]

Message ID 20220317190133.415743-1-jwakely@redhat.com
State New
Headers show
Series libstdc++: Reduce header dependencies from PSTL headers [PR92546] | expand

Commit Message

Jonathan Wakely March 17, 2022, 7:01 p.m. UTC
Tested x86_64-linux. Tom, any objection?

-- >8 --

This avoids including the whole of <functional> in <algorithm>, as the
<pstl/glue_algorithm_defs.h> header only actually needs std::pair.

This also avoids including <iterator> in <pstl/utils.h>, which only
needs <type_traits>, std::bad_alloc, and std::terminate (which can be
repalced with std::__terminate). This matters less, because
<pstl/utils.h> is only included by the <pstl/*_impl.h> headers and they
all use <iterator> anyway, and are only included by <execution>.

libstdc++-v3/ChangeLog:

	PR libstdc++/92546
	* include/pstl/glue_algorithm_defs.h: Replace <functional> with
	<bits/stl_pair.h>.
	* include/pstl/utils.h: Replace <iterator> with <type_traits>.
	(__pstl::__internal::__except_handler): Use std::__terminate
	instead of std::terminate.
	* src/c++17/fs_path.cc: Include <array>.
	* testsuite/25_algorithms/adjacent_find/constexpr.cc: Include
	<functional>.
	* testsuite/25_algorithms/binary_search/constexpr.cc: Likewise.
	* testsuite/25_algorithms/clamp/constrained.cc: Likewise.
	* testsuite/25_algorithms/equal/constrained.cc: Likewise.
	* testsuite/25_algorithms/for_each/constrained.cc: Likewise.
	* testsuite/25_algorithms/includes/constrained.cc: Likewise.
	* testsuite/25_algorithms/is_heap/constexpr.cc: Likewise.
	* testsuite/25_algorithms/is_heap_until/constexpr.cc: Likewise.
	* testsuite/25_algorithms/is_permutation/constrained.cc: Include
	<iterator>.
	* testsuite/25_algorithms/is_sorted/constexpr.cc: Include
	<functional>.
	* testsuite/25_algorithms/is_sorted_until/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/lexicographical_compare/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/lexicographical_compare/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/lexicographical_compare_three_way/1.cc:
	Include <array>.
	* testsuite/25_algorithms/lower_bound/constexpr.cc: Include
	<functional>.
	* testsuite/25_algorithms/max/constrained.cc: Likewise.
	* testsuite/25_algorithms/max_element/constrained.cc: Likewise.
	* testsuite/25_algorithms/min/constrained.cc: Likewise.
	* testsuite/25_algorithms/min_element/constrained.cc: Likewise.
	* testsuite/25_algorithms/minmax_element/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/mismatch/constexpr.cc: Likewise.
	* testsuite/25_algorithms/move/93872.cc: Likewise.
	* testsuite/25_algorithms/move_backward/93872.cc: Include
	<iterator>.
	* testsuite/25_algorithms/nth_element/constexpr.cc: Include
	<functional>.
	* testsuite/25_algorithms/partial_sort/constexpr.cc: Likewise.
	* testsuite/25_algorithms/partial_sort_copy/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/search/constexpr.cc: Likewise.
	* testsuite/25_algorithms/search_n/constrained.cc: Likewise.
	* testsuite/25_algorithms/set_difference/constexpr.cc: Likewise.
	* testsuite/25_algorithms/set_difference/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/set_intersection/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/set_intersection/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/set_symmetric_difference/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/set_union/constexpr.cc: Likewise.
	* testsuite/25_algorithms/set_union/constrained.cc: Likewise.
	* testsuite/25_algorithms/sort/constexpr.cc: Likewise.
	* testsuite/25_algorithms/sort_heap/constexpr.cc: Likewise.
	* testsuite/25_algorithms/transform/constrained.cc: Likewise.
	* testsuite/25_algorithms/unique/constexpr.cc: Likewise.
	* testsuite/25_algorithms/unique/constrained.cc: Likewise.
	* testsuite/25_algorithms/unique_copy/constexpr.cc: Likewise.
	* testsuite/25_algorithms/upper_bound/constexpr.cc: Likewise.
	* testsuite/std/ranges/adaptors/elements.cc: Include <vector>.
	* testsuite/std/ranges/adaptors/lazy_split.cc: Likewise.
	* testsuite/std/ranges/adaptors/split.cc: Likewise.
---
 libstdc++-v3/include/pstl/glue_algorithm_defs.h               | 2 +-
 libstdc++-v3/include/pstl/utils.h                             | 4 ++--
 libstdc++-v3/src/c++17/fs_path.cc                             | 1 +
 .../testsuite/25_algorithms/adjacent_find/constexpr.cc        | 1 +
 .../testsuite/25_algorithms/binary_search/constexpr.cc        | 1 +
 libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc     | 1 +
 libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc     | 1 +
 libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc  | 1 +
 libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc  | 1 +
 libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc     | 1 +
 .../testsuite/25_algorithms/is_heap_until/constexpr.cc        | 1 +
 .../testsuite/25_algorithms/is_permutation/constrained.cc     | 1 +
 libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc   | 1 +
 .../testsuite/25_algorithms/is_sorted_until/constexpr.cc      | 1 +
 .../25_algorithms/lexicographical_compare/constexpr.cc        | 1 +
 .../25_algorithms/lexicographical_compare/constrained.cc      | 1 +
 .../25_algorithms/lexicographical_compare_three_way/1.cc      | 1 +
 libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc | 1 +
 libstdc++-v3/testsuite/25_algorithms/max/constrained.cc       | 1 +
 .../testsuite/25_algorithms/max_element/constrained.cc        | 1 +
 libstdc++-v3/testsuite/25_algorithms/min/constrained.cc       | 1 +
 .../testsuite/25_algorithms/min_element/constrained.cc        | 1 +
 .../testsuite/25_algorithms/minmax_element/constrained.cc     | 1 +
 libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc    | 1 +
 libstdc++-v3/testsuite/25_algorithms/move/93872.cc            | 1 +
 libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc   | 1 +
 libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc | 1 +
 .../testsuite/25_algorithms/partial_sort/constexpr.cc         | 1 +
 .../testsuite/25_algorithms/partial_sort_copy/constexpr.cc    | 1 +
 libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc      | 1 +
 libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc  | 1 +
 .../testsuite/25_algorithms/set_difference/constexpr.cc       | 1 +
 .../testsuite/25_algorithms/set_difference/constrained.cc     | 1 +
 .../testsuite/25_algorithms/set_intersection/constexpr.cc     | 1 +
 .../testsuite/25_algorithms/set_intersection/constrained.cc   | 1 +
 .../25_algorithms/set_symmetric_difference/constexpr.cc       | 1 +
 libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc   | 1 +
 libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc | 1 +
 libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc        | 1 +
 libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc   | 1 +
 libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc | 1 +
 libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc      | 1 +
 libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc    | 1 +
 libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc | 1 +
 libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc | 1 +
 libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc        | 3 ++-
 libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc      | 1 +
 libstdc++-v3/testsuite/std/ranges/adaptors/split.cc           | 1 +
 48 files changed, 50 insertions(+), 4 deletions(-)

Comments

Thomas Rodgers March 17, 2022, 8:43 p.m. UTC | #1
Looks ok to me. I just am curious, does the change to src/c++17/fs_path.cc
need to be part of this change (It's not obvious to me that it is related
to the other changes in the patch).

On Thu, Mar 17, 2022 at 12:01 PM Jonathan Wakely <jwakely@redhat.com> wrote:

> Tested x86_64-linux. Tom, any objection?
>
> -- >8 --
>
> This avoids including the whole of <functional> in <algorithm>, as the
> <pstl/glue_algorithm_defs.h> header only actually needs std::pair.
>
> This also avoids including <iterator> in <pstl/utils.h>, which only
> needs <type_traits>, std::bad_alloc, and std::terminate (which can be
> repalced with std::__terminate). This matters less, because
> <pstl/utils.h> is only included by the <pstl/*_impl.h> headers and they
> all use <iterator> anyway, and are only included by <execution>.
>
> libstdc++-v3/ChangeLog:
>
>         PR libstdc++/92546
>         * include/pstl/glue_algorithm_defs.h: Replace <functional> with
>         <bits/stl_pair.h>.
>         * include/pstl/utils.h: Replace <iterator> with <type_traits>.
>         (__pstl::__internal::__except_handler): Use std::__terminate
>         instead of std::terminate.
>         * src/c++17/fs_path.cc: Include <array>.
>         * testsuite/25_algorithms/adjacent_find/constexpr.cc: Include
>         <functional>.
>         * testsuite/25_algorithms/binary_search/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/clamp/constrained.cc: Likewise.
>         * testsuite/25_algorithms/equal/constrained.cc: Likewise.
>         * testsuite/25_algorithms/for_each/constrained.cc: Likewise.
>         * testsuite/25_algorithms/includes/constrained.cc: Likewise.
>         * testsuite/25_algorithms/is_heap/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/is_heap_until/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/is_permutation/constrained.cc: Include
>         <iterator>.
>         * testsuite/25_algorithms/is_sorted/constexpr.cc: Include
>         <functional>.
>         * testsuite/25_algorithms/is_sorted_until/constexpr.cc:
>         Likewise.
>         * testsuite/25_algorithms/lexicographical_compare/constexpr.cc:
>         Likewise.
>         * testsuite/25_algorithms/lexicographical_compare/constrained.cc:
>         Likewise.
>         * testsuite/25_algorithms/lexicographical_compare_three_way/1.cc:
>         Include <array>.
>         * testsuite/25_algorithms/lower_bound/constexpr.cc: Include
>         <functional>.
>         * testsuite/25_algorithms/max/constrained.cc: Likewise.
>         * testsuite/25_algorithms/max_element/constrained.cc: Likewise.
>         * testsuite/25_algorithms/min/constrained.cc: Likewise.
>         * testsuite/25_algorithms/min_element/constrained.cc: Likewise.
>         * testsuite/25_algorithms/minmax_element/constrained.cc:
>         Likewise.
>         * testsuite/25_algorithms/mismatch/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/move/93872.cc: Likewise.
>         * testsuite/25_algorithms/move_backward/93872.cc: Include
>         <iterator>.
>         * testsuite/25_algorithms/nth_element/constexpr.cc: Include
>         <functional>.
>         * testsuite/25_algorithms/partial_sort/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/partial_sort_copy/constexpr.cc:
>         Likewise.
>         * testsuite/25_algorithms/search/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/search_n/constrained.cc: Likewise.
>         * testsuite/25_algorithms/set_difference/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/set_difference/constrained.cc:
>         Likewise.
>         * testsuite/25_algorithms/set_intersection/constexpr.cc:
>         Likewise.
>         * testsuite/25_algorithms/set_intersection/constrained.cc:
>         Likewise.
>         * testsuite/25_algorithms/set_symmetric_difference/constexpr.cc:
>         Likewise.
>         * testsuite/25_algorithms/set_union/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/set_union/constrained.cc: Likewise.
>         * testsuite/25_algorithms/sort/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/sort_heap/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/transform/constrained.cc: Likewise.
>         * testsuite/25_algorithms/unique/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/unique/constrained.cc: Likewise.
>         * testsuite/25_algorithms/unique_copy/constexpr.cc: Likewise.
>         * testsuite/25_algorithms/upper_bound/constexpr.cc: Likewise.
>         * testsuite/std/ranges/adaptors/elements.cc: Include <vector>.
>         * testsuite/std/ranges/adaptors/lazy_split.cc: Likewise.
>         * testsuite/std/ranges/adaptors/split.cc: Likewise.
> ---
>  libstdc++-v3/include/pstl/glue_algorithm_defs.h               | 2 +-
>  libstdc++-v3/include/pstl/utils.h                             | 4 ++--
>  libstdc++-v3/src/c++17/fs_path.cc                             | 1 +
>  .../testsuite/25_algorithms/adjacent_find/constexpr.cc        | 1 +
>  .../testsuite/25_algorithms/binary_search/constexpr.cc        | 1 +
>  libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc     | 1 +
>  libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc     | 1 +
>  libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc  | 1 +
>  libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc  | 1 +
>  libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc     | 1 +
>  .../testsuite/25_algorithms/is_heap_until/constexpr.cc        | 1 +
>  .../testsuite/25_algorithms/is_permutation/constrained.cc     | 1 +
>  libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc   | 1 +
>  .../testsuite/25_algorithms/is_sorted_until/constexpr.cc      | 1 +
>  .../25_algorithms/lexicographical_compare/constexpr.cc        | 1 +
>  .../25_algorithms/lexicographical_compare/constrained.cc      | 1 +
>  .../25_algorithms/lexicographical_compare_three_way/1.cc      | 1 +
>  libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc | 1 +
>  libstdc++-v3/testsuite/25_algorithms/max/constrained.cc       | 1 +
>  .../testsuite/25_algorithms/max_element/constrained.cc        | 1 +
>  libstdc++-v3/testsuite/25_algorithms/min/constrained.cc       | 1 +
>  .../testsuite/25_algorithms/min_element/constrained.cc        | 1 +
>  .../testsuite/25_algorithms/minmax_element/constrained.cc     | 1 +
>  libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc    | 1 +
>  libstdc++-v3/testsuite/25_algorithms/move/93872.cc            | 1 +
>  libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc   | 1 +
>  libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc | 1 +
>  .../testsuite/25_algorithms/partial_sort/constexpr.cc         | 1 +
>  .../testsuite/25_algorithms/partial_sort_copy/constexpr.cc    | 1 +
>  libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc      | 1 +
>  libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc  | 1 +
>  .../testsuite/25_algorithms/set_difference/constexpr.cc       | 1 +
>  .../testsuite/25_algorithms/set_difference/constrained.cc     | 1 +
>  .../testsuite/25_algorithms/set_intersection/constexpr.cc     | 1 +
>  .../testsuite/25_algorithms/set_intersection/constrained.cc   | 1 +
>  .../25_algorithms/set_symmetric_difference/constexpr.cc       | 1 +
>  libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc   | 1 +
>  libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc | 1 +
>  libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc        | 1 +
>  libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc   | 1 +
>  libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc | 1 +
>  libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc      | 1 +
>  libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc    | 1 +
>  libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc | 1 +
>  libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc | 1 +
>  libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc        | 3 ++-
>  libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc      | 1 +
>  libstdc++-v3/testsuite/std/ranges/adaptors/split.cc           | 1 +
>  48 files changed, 50 insertions(+), 4 deletions(-)
>
> diff --git a/libstdc++-v3/include/pstl/glue_algorithm_defs.h
> b/libstdc++-v3/include/pstl/glue_algorithm_defs.h
> index 48bc56ae401..cef78e22e31 100644
> --- a/libstdc++-v3/include/pstl/glue_algorithm_defs.h
> +++ b/libstdc++-v3/include/pstl/glue_algorithm_defs.h
> @@ -10,7 +10,7 @@
>  #ifndef _PSTL_GLUE_ALGORITHM_DEFS_H
>  #define _PSTL_GLUE_ALGORITHM_DEFS_H
>
> -#include <functional>
> +#include <bits/stl_pair.h>
>
>  #include "execution_defs.h"
>
> diff --git a/libstdc++-v3/include/pstl/utils.h
> b/libstdc++-v3/include/pstl/utils.h
> index 1711f292678..0e908f1c539 100644
> --- a/libstdc++-v3/include/pstl/utils.h
> +++ b/libstdc++-v3/include/pstl/utils.h
> @@ -11,7 +11,7 @@
>  #define _PSTL_UTILS_H
>
>  #include <new>
> -#include <iterator>
> +#include <type_traits>
>
>  namespace __pstl
>  {
> @@ -32,7 +32,7 @@ __except_handler(_Fp __f)
>      }
>      catch (...)
>      {
> -        std::terminate(); // Good bye according to the standard
> [algorithms.parallel.exceptions]
> +        std::__terminate(); // Good bye according to the standard
> [algorithms.parallel.exceptions]
>      }
>  }
>
> diff --git a/libstdc++-v3/src/c++17/fs_path.cc
> b/libstdc++-v3/src/c++17/fs_path.cc
> index a44fa284879..047082350ec 100644
> --- a/libstdc++-v3/src/c++17/fs_path.cc
> +++ b/libstdc++-v3/src/c++17/fs_path.cc
> @@ -33,6 +33,7 @@
>
>  #include <filesystem>
>  #include <algorithm>
> +#include <array>
>  #include <bits/stl_uninitialized.h>
>
>  namespace fs = std::filesystem;
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/adjacent_find/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/adjacent_find/constexpr.cc
> index d2a741e8c91..772db230041 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/adjacent_find/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/adjacent_find/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr std::array<int, 12> car{{0, 1, 2, 3, 4, 5, 6, 6, 8, 9, 9, 11}};
>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/binary_search/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/binary_search/constexpr.cc
> index 733a18c31ad..f7a5fa12d3b 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/binary_search/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/binary_search/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc
> index 41b1f679234..5464dcf9a83 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc
> index ac034813255..cab35525c2d 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc
> index 85044a15092..9ffc33f88d5 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc
> index 1dd4312b4c8..a0ace5d82c2 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc
> index 420ff94cfdc..a2e8e3981a1 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc
> @@ -19,6 +19,7 @@
>  // { dg-do compile { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <array>
>
>  // heap
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/is_heap_until/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/is_heap_until/constexpr.cc
> index 53e991fa4b9..be316eb8e95 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/is_heap_until/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/is_heap_until/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  // heap
>  constexpr std::array<int, 23>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/is_permutation/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/is_permutation/constrained.cc
> index b5814a05add..8d2013620b5 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/is_permutation/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/is_permutation/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <iterator>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc
> index e020d2ee17e..422c1ceaf65 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr std::array<int, 12> ca0{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}};
>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constexpr.cc
> index 161437ed2a1..b3906330d69 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constexpr.cc
> index 855da0c766b..d69527113d5 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constexpr.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
> index 708f3dd8aba..ef904e65d68 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare_three_way/1.cc
> b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare_three_way/1.cc
> index 48be0f6412b..16b77033713 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare_three_way/1.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare_three_way/1.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <array>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc
> index 6041ffcb0c7..8cd8fb98921 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/max/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/max/constrained.cc
> index bba8e807ed6..10af2b172f8 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/max/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/max/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/max_element/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/max_element/constrained.cc
> index 7139e37fcc9..a4291b29381 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/max_element/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/max_element/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/min/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/min/constrained.cc
> index 8bec9f9debc..405bf968335 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/min/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/min/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/min_element/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/min_element/constrained.cc
> index bc07e3fe5e4..94ec58708f7 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/min_element/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/min_element/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc
> index f8785c4c45c..df199230a78 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc
> index 3b4433c05f4..f32c1a6224d 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/move/93872.cc
> b/libstdc++-v3/testsuite/25_algorithms/move/93872.cc
> index b7801269545..4b0c8105171 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/move/93872.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/move/93872.cc
> @@ -19,6 +19,7 @@
>  // { dg-do compile { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>
>  struct X
>  {
> diff --git a/libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc
> b/libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc
> index af1fd106334..4dc51a178fa 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc
> @@ -19,6 +19,7 @@
>  // { dg-do compile { target c++2a } }
>
>  #include <algorithm>
> +#include <iterator>
>
>  struct X
>  {
> diff --git a/libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc
> index 36b71e44b78..5bd424a9cea 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/partial_sort/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/partial_sort/constexpr.cc
> index 63ff97eb3a1..f24db97b51c 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/partial_sort/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/partial_sort/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/constexpr.cc
> index eca915fd57a..c87b9785790 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc
> index de0ff5d2193..a796a081c85 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc
> index d91daf74f1f..0ba12fe7afa 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/set_difference/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/set_difference/constexpr.cc
> index 5c520ecaa4e..0eb0f6a0156 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/set_difference/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/set_difference/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/set_difference/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/set_difference/constrained.cc
> index b27d1c73c5b..bee831fd0bf 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/set_difference/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/set_difference/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/set_intersection/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/set_intersection/constexpr.cc
> index b561f18302e..15ee0169950 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/set_intersection/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/set_intersection/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/set_intersection/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/set_intersection/constrained.cc
> index 39311f26f5c..c80d0408aae 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/set_intersection/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/set_intersection/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/set_symmetric_difference/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/set_symmetric_difference/constexpr.cc
> index fc578cc7e79..ee9934408ca 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/set_symmetric_difference/constexpr.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/set_symmetric_difference/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc
> index 87821137382..e9a1cbfd658 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc
> index f53827fd209..2e8a603c4d7 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc
> index b6a71294782..2a55f3ec702 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc
> index b799f566da5..98c5f01b6ad 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc
> index 1db415697e4..b3005d96147 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc
> @@ -19,6 +19,7 @@
>  // { dg-do run { target c++2a } }
>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc
> index 7475ec721e5..384cec27d56 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc
> b/libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc
> index f0fc3c3b6b5..2f0f6872440 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc
> @@ -20,6 +20,7 @@
>
>  #include <list>
>  #include <algorithm>
> +#include <functional>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc
> index 200a5ce470f..bfa375c023f 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc
> b/libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc
> index 2e87bab0170..0735c608a84 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc
> @@ -20,6 +20,7 @@
>
>  #include <algorithm>
>  #include <array>
> +#include <functional>
>
>  constexpr bool
>  test()
> diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc
> b/libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc
> index 93a1c6d3053..30e4e419a34 100644
> --- a/libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc
> +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc
> @@ -20,9 +20,10 @@
>
>  #include <algorithm>
>  #include <ranges>
> +#include <tuple>
> +#include <vector>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
> -#include <tuple>
>
>  namespace ranges = std::ranges;
>  namespace views = ranges::views;
> diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc
> b/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc
> index e46f76d7632..21c0837cdd3 100644
> --- a/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc
> +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc
> @@ -22,6 +22,7 @@
>  #include <ranges>
>  #include <string>
>  #include <string_view>
> +#include <vector>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc
> b/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc
> index ca10608efb5..a46f898a663 100644
> --- a/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc
> +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc
> @@ -22,6 +22,7 @@
>  #include <ranges>
>  #include <string>
>  #include <string_view>
> +#include <vector>
>  #include <testsuite_hooks.h>
>  #include <testsuite_iterators.h>
>
> --
> 2.34.1
>
>
Jonathan Wakely March 18, 2022, 10:16 a.m. UTC | #2
On Thu, 17 Mar 2022 at 20:44, Thomas Rodgers wrote:
>
> Looks ok to me. I just am curious, does the change to src/c++17/fs_path.cc need to be part of this change (It's not obvious to me that it is related to the other changes in the patch).

It's related. fs_path.cc uses std::array but was not including <array>
directly, it was accidentally relying on it being there via
<algorithm>. After this change, <algorithm> doesn't include
<functional>, so doesn't include <array> and so fs_path.cc needs to be
fixed.
Jonathan Wakely March 18, 2022, 10:46 a.m. UTC | #3
On Fri, 18 Mar 2022 at 10:16, Jonathan Wakely wrote:
>
> On Thu, 17 Mar 2022 at 20:44, Thomas Rodgers wrote:
> >
> > Looks ok to me. I just am curious, does the change to src/c++17/fs_path.cc need to be part of this change (It's not obvious to me that it is related to the other changes in the patch).
>
> It's related. fs_path.cc uses std::array but was not including <array>
> directly, it was accidentally relying on it being there via
> <algorithm>. After this change, <algorithm> doesn't include
> <functional>, so doesn't include <array> and so fs_path.cc needs to be
> fixed.

Pushed to trunk now.
diff mbox series

Patch

diff --git a/libstdc++-v3/include/pstl/glue_algorithm_defs.h b/libstdc++-v3/include/pstl/glue_algorithm_defs.h
index 48bc56ae401..cef78e22e31 100644
--- a/libstdc++-v3/include/pstl/glue_algorithm_defs.h
+++ b/libstdc++-v3/include/pstl/glue_algorithm_defs.h
@@ -10,7 +10,7 @@ 
 #ifndef _PSTL_GLUE_ALGORITHM_DEFS_H
 #define _PSTL_GLUE_ALGORITHM_DEFS_H
 
-#include <functional>
+#include <bits/stl_pair.h>
 
 #include "execution_defs.h"
 
diff --git a/libstdc++-v3/include/pstl/utils.h b/libstdc++-v3/include/pstl/utils.h
index 1711f292678..0e908f1c539 100644
--- a/libstdc++-v3/include/pstl/utils.h
+++ b/libstdc++-v3/include/pstl/utils.h
@@ -11,7 +11,7 @@ 
 #define _PSTL_UTILS_H
 
 #include <new>
-#include <iterator>
+#include <type_traits>
 
 namespace __pstl
 {
@@ -32,7 +32,7 @@  __except_handler(_Fp __f)
     }
     catch (...)
     {
-        std::terminate(); // Good bye according to the standard [algorithms.parallel.exceptions]
+        std::__terminate(); // Good bye according to the standard [algorithms.parallel.exceptions]
     }
 }
 
diff --git a/libstdc++-v3/src/c++17/fs_path.cc b/libstdc++-v3/src/c++17/fs_path.cc
index a44fa284879..047082350ec 100644
--- a/libstdc++-v3/src/c++17/fs_path.cc
+++ b/libstdc++-v3/src/c++17/fs_path.cc
@@ -33,6 +33,7 @@ 
 
 #include <filesystem>
 #include <algorithm>
+#include <array>
 #include <bits/stl_uninitialized.h>
 
 namespace fs = std::filesystem;
diff --git a/libstdc++-v3/testsuite/25_algorithms/adjacent_find/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/adjacent_find/constexpr.cc
index d2a741e8c91..772db230041 100644
--- a/libstdc++-v3/testsuite/25_algorithms/adjacent_find/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/adjacent_find/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr std::array<int, 12> car{{0, 1, 2, 3, 4, 5, 6, 6, 8, 9, 9, 11}};
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/binary_search/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/binary_search/constexpr.cc
index 733a18c31ad..f7a5fa12d3b 100644
--- a/libstdc++-v3/testsuite/25_algorithms/binary_search/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/binary_search/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc
index 41b1f679234..5464dcf9a83 100644
--- a/libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/clamp/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc
index ac034813255..cab35525c2d 100644
--- a/libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/equal/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc
index 85044a15092..9ffc33f88d5 100644
--- a/libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/for_each/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc
index 1dd4312b4c8..a0ace5d82c2 100644
--- a/libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/includes/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc
index 420ff94cfdc..a2e8e3981a1 100644
--- a/libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/is_heap/constexpr.cc
@@ -19,6 +19,7 @@ 
 // { dg-do compile { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <array>
 
 // heap
diff --git a/libstdc++-v3/testsuite/25_algorithms/is_heap_until/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/is_heap_until/constexpr.cc
index 53e991fa4b9..be316eb8e95 100644
--- a/libstdc++-v3/testsuite/25_algorithms/is_heap_until/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/is_heap_until/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 // heap
 constexpr std::array<int, 23>
diff --git a/libstdc++-v3/testsuite/25_algorithms/is_permutation/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/is_permutation/constrained.cc
index b5814a05add..8d2013620b5 100644
--- a/libstdc++-v3/testsuite/25_algorithms/is_permutation/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/is_permutation/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <iterator>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc
index e020d2ee17e..422c1ceaf65 100644
--- a/libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/is_sorted/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr std::array<int, 12> ca0{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}};
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constexpr.cc
index 161437ed2a1..b3906330d69 100644
--- a/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constexpr.cc
index 855da0c766b..d69527113d5 100644
--- a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
index 708f3dd8aba..ef904e65d68 100644
--- a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare_three_way/1.cc b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare_three_way/1.cc
index 48be0f6412b..16b77033713 100644
--- a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare_three_way/1.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare_three_way/1.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <array>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc
index 6041ffcb0c7..8cd8fb98921 100644
--- a/libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/max/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/max/constrained.cc
index bba8e807ed6..10af2b172f8 100644
--- a/libstdc++-v3/testsuite/25_algorithms/max/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/max/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/max_element/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/max_element/constrained.cc
index 7139e37fcc9..a4291b29381 100644
--- a/libstdc++-v3/testsuite/25_algorithms/max_element/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/max_element/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/min/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/min/constrained.cc
index 8bec9f9debc..405bf968335 100644
--- a/libstdc++-v3/testsuite/25_algorithms/min/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/min/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/min_element/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/min_element/constrained.cc
index bc07e3fe5e4..94ec58708f7 100644
--- a/libstdc++-v3/testsuite/25_algorithms/min_element/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/min_element/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc
index f8785c4c45c..df199230a78 100644
--- a/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc
index 3b4433c05f4..f32c1a6224d 100644
--- a/libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/mismatch/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/move/93872.cc b/libstdc++-v3/testsuite/25_algorithms/move/93872.cc
index b7801269545..4b0c8105171 100644
--- a/libstdc++-v3/testsuite/25_algorithms/move/93872.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/move/93872.cc
@@ -19,6 +19,7 @@ 
 // { dg-do compile { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 
 struct X
 {
diff --git a/libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc b/libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc
index af1fd106334..4dc51a178fa 100644
--- a/libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/move_backward/93872.cc
@@ -19,6 +19,7 @@ 
 // { dg-do compile { target c++2a } }
 
 #include <algorithm>
+#include <iterator>
 
 struct X
 {
diff --git a/libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc
index 36b71e44b78..5bd424a9cea 100644
--- a/libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/partial_sort/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/partial_sort/constexpr.cc
index 63ff97eb3a1..f24db97b51c 100644
--- a/libstdc++-v3/testsuite/25_algorithms/partial_sort/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/partial_sort/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/constexpr.cc
index eca915fd57a..c87b9785790 100644
--- a/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc
index de0ff5d2193..a796a081c85 100644
--- a/libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/search/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc
index d91daf74f1f..0ba12fe7afa 100644
--- a/libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/search_n/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/set_difference/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/set_difference/constexpr.cc
index 5c520ecaa4e..0eb0f6a0156 100644
--- a/libstdc++-v3/testsuite/25_algorithms/set_difference/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/set_difference/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/set_difference/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/set_difference/constrained.cc
index b27d1c73c5b..bee831fd0bf 100644
--- a/libstdc++-v3/testsuite/25_algorithms/set_difference/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/set_difference/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/set_intersection/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/set_intersection/constexpr.cc
index b561f18302e..15ee0169950 100644
--- a/libstdc++-v3/testsuite/25_algorithms/set_intersection/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/set_intersection/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/set_intersection/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/set_intersection/constrained.cc
index 39311f26f5c..c80d0408aae 100644
--- a/libstdc++-v3/testsuite/25_algorithms/set_intersection/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/set_intersection/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/set_symmetric_difference/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/set_symmetric_difference/constexpr.cc
index fc578cc7e79..ee9934408ca 100644
--- a/libstdc++-v3/testsuite/25_algorithms/set_symmetric_difference/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/set_symmetric_difference/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc
index 87821137382..e9a1cbfd658 100644
--- a/libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/set_union/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc
index f53827fd209..2e8a603c4d7 100644
--- a/libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/set_union/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc
index b6a71294782..2a55f3ec702 100644
--- a/libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc
index b799f566da5..98c5f01b6ad 100644
--- a/libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc
index 1db415697e4..b3005d96147 100644
--- a/libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/transform/constrained.cc
@@ -19,6 +19,7 @@ 
 // { dg-do run { target c++2a } }
 
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc
index 7475ec721e5..384cec27d56 100644
--- a/libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/unique/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc
index f0fc3c3b6b5..2f0f6872440 100644
--- a/libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/unique/constrained.cc
@@ -20,6 +20,7 @@ 
 
 #include <list>
 #include <algorithm>
+#include <functional>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc
index 200a5ce470f..bfa375c023f 100644
--- a/libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/unique_copy/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc b/libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc
index 2e87bab0170..0735c608a84 100644
--- a/libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/upper_bound/constexpr.cc
@@ -20,6 +20,7 @@ 
 
 #include <algorithm>
 #include <array>
+#include <functional>
 
 constexpr bool
 test()
diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc
index 93a1c6d3053..30e4e419a34 100644
--- a/libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc
+++ b/libstdc++-v3/testsuite/std/ranges/adaptors/elements.cc
@@ -20,9 +20,10 @@ 
 
 #include <algorithm>
 #include <ranges>
+#include <tuple>
+#include <vector>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
-#include <tuple>
 
 namespace ranges = std::ranges;
 namespace views = ranges::views;
diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc
index e46f76d7632..21c0837cdd3 100644
--- a/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc
+++ b/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc
@@ -22,6 +22,7 @@ 
 #include <ranges>
 #include <string>
 #include <string_view>
+#include <vector>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc
index ca10608efb5..a46f898a663 100644
--- a/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc
+++ b/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc
@@ -22,6 +22,7 @@ 
 #include <ranges>
 #include <string>
 #include <string_view>
+#include <vector>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>