gcc/libstdc++-v3/include/std
Jonathan Wakely 16158c9649 libstdc++: Remove unnecessary uses of <utility>
The <algorithm> header includes <utility>, with a comment referring to
UK-300, a National Body comment on the C++11 draft. That comment
proposed to move std::swap to <utility> and then require <algorithm> to
include <utility>. The comment was rejected, so we do not need to
implement the suggestion. For backwards compatibility with C++03 we do
want <algorithm> to define std::swap, but it does so anyway via
<bits/move.h>. We don't need the whole of <utility> to do that.

A few other headers that need std::swap can include <bits/move.h> to
get it, instead of <utility>.

There are several headers that include <utility> to get std::pair, but
they can use <bits/stl_pair.h> to get it without also including the
rel_ops namespace and other contents of <utility>.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/std/algorithm: Do not include <utility>.
	* include/std/functional: Likewise.
	* include/std/regex: Include <bits/stl_pair.h> instead of
	<utility>.
	* include/debug/map.h: Likewise.
	* include/debug/multimap.h: Likewise.
	* include/debug/multiset.h: Likewise.
	* include/debug/set.h: Likewise.
	* include/debug/vector: Likewise.
	* include/bits/fs_path.h: Likewise.
	* include/bits/unique_ptr.h: Do not include <utility>.
	* include/experimental/any: Likewise.
	* include/experimental/executor: Likewise.
	* include/experimental/memory: Likewise.
	* include/experimental/optional: Likewise.
	* include/experimental/socket: Use __exchange instead
	of std::exchange.
	* src/filesystem/ops-common.h: Likewise.
	* testsuite/20_util/default_delete/48631_neg.cc: Adjust expected
	errors to not use a hardcoded line number.
	* testsuite/20_util/default_delete/void_neg.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/constrained.cc:
	Include <utility> for std::as_const.
	* testsuite/20_util/specialized_algorithms/uninitialized_default_construct/constrained.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_move/constrained.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_value_construct/constrained.cc:
	Likewise.
	* testsuite/23_containers/vector/cons/destructible_debug_neg.cc:
	Adjust dg-error line number.
2021-07-27 12:04:18 +01:00
..
algorithm libstdc++: Remove unnecessary uses of <utility> 2021-07-27 12:04:18 +01:00
any libstdc++: Reduce header dependencies on <array> and <utility> 2021-07-27 12:04:18 +01:00
array libstdc++: Reduce header dependencies on <array> and <utility> 2021-07-27 12:04:18 +01:00
atomic
barrier
bit
bitset
charconv
chrono
codecvt
complex
concepts
condition_variable
coroutine
deque
execution
filesystem
forward_list
fstream
functional libstdc++: Remove unnecessary uses of <utility> 2021-07-27 12:04:18 +01:00
future libstdc++: Reduce headers included by <future> 2021-07-23 13:27:45 +01:00
iomanip
ios
iosfwd
iostream
istream
iterator
latch
limits libstdc++: Use __extension__ instead of diagnostic pragmas 2021-07-16 15:03:03 +01:00
list
locale
map
memory
memory_resource libstdc++: Reduce header dependencies on <array> and <utility> 2021-07-27 12:04:18 +01:00
mutex
numbers
numeric
optional libstdc++: Reduce header dependencies on <array> and <utility> 2021-07-27 12:04:18 +01:00
ostream
queue
random
ranges libstdc++: invalid default init in _CachedPosition [PR101231] 2021-07-16 09:44:42 -04:00
ratio
regex libstdc++: Remove unnecessary uses of <utility> 2021-07-27 12:04:18 +01:00
scoped_allocator
semaphore
set
shared_mutex
source_location
span
sstream
stack
stdexcept
stop_token
streambuf
string
string_view libstdc++: Add noexcept-specifier to basic_string_view(It, End) 2021-07-14 12:23:33 +01:00
syncstream
system_error
thread
tuple libstdc++: Reduce header dependencies on <array> and <utility> 2021-07-27 12:04:18 +01:00
type_traits libstdc++: Reduce header dependencies on <array> and <utility> 2021-07-27 12:04:18 +01:00
typeindex
unordered_map
unordered_set
utility libstdc++: Reduce header dependencies on <array> and <utility> 2021-07-27 12:04:18 +01:00
valarray
variant libstdc++: Reduce header dependencies on <array> and <utility> 2021-07-27 12:04:18 +01:00
vector
version libstdc++: Reduce header dependencies on <array> and <utility> 2021-07-27 12:04:18 +01:00