gcc/libstdc++-v3/testsuite
Jonathan Wakely 45cc42d6dc
libstdc++: Make equal and is_permutation short-circuit (LWG 3560)
We already implement short-circuiting for random access iterators, but
we also need to do so for ranges::equal and ranges::is_permutation when
given sized ranges that are not random access ranges (e.g. std::list).

libstdc++-v3/ChangeLog:

	* include/bits/ranges_algo.h (__is_permutation_fn::operator()):
	Short-circuit for sized ranges with different sizes, as per LWG
	3560.
	* include/bits/ranges_algobase.h (__equal_fn::operator()):
	Likewise.
	* include/bits/stl_algo.h (__is_permutation): Use if-constexpr
	for random access iterator branches.
	* include/bits/stl_algobase.h (__equal4): Likewise.
	* testsuite/25_algorithms/equal/lwg3560.cc: New test.
	* testsuite/25_algorithms/is_permutation/lwg3560.cc: New test.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
2024-11-14 20:01:25 +00:00
..
17_intro libstdc++: Do not define _Insert_base::try_emplace before C++17 2024-11-08 14:39:56 +00:00
18_support libstdc++: Deprecate useless <cxxx> compatibility headers for C++17 2024-11-06 12:47:19 +00:00
19_diagnostics libstdc++: Build libbacktrace and 19_diagnostics/stacktrace with -funwind-tables [PR111641] 2024-05-29 10:08:07 +02:00
20_util libstdc++: Refactor std::hash specializations 2024-11-13 20:21:41 +00:00
21_strings libstdc++: Disable parts of new test that depend on constexpr std::string 2024-10-25 10:23:56 +01:00
22_locale libstdc++: Make _GLIBCXX_NODISCARD work for C++11 and C++14 2024-11-14 17:00:40 +00:00
23_containers libstdc++: Simplify _Hashtable merge functions 2024-11-13 20:21:41 +00:00
24_iterators libstdc++: Add missing constraint to operator+ for std::move_iterator 2024-11-14 15:39:03 +00:00
25_algorithms libstdc++: Make equal and is_permutation short-circuit (LWG 3560) 2024-11-14 20:01:25 +00:00
26_numerics libstdc++: Deprecate useless <cxxx> compatibility headers for C++17 2024-11-06 12:47:19 +00:00
27_io libstdc++: Make _GLIBCXX_NODISCARD work for C++11 and C++14 2024-11-14 17:00:40 +00:00
28_regex libstdc++: drop bogus 'dg_do run' directive 2024-07-31 17:22:42 +01:00
29_atomics libstdc++: Fix test FAIL due to -Wpointer-arith 2024-09-27 16:28:12 +01:00
30_threads libstdc++: Ignore _GLIBCXX_USE_POSIX_SEMAPHORE if not supported [PR116992] 2024-10-09 13:41:06 +01:00
abi libstdc++: Simplify <ext/aligned_buffer.h> class templates 2024-06-28 20:19:02 +01:00
backward
config
data
decimal [libstdc++] [testsuite] require dfprt on some tests 2024-07-12 05:42:19 -03:00
experimental [libstdc++] [testsuite] defer to check_vect_support* [PR115454] 2024-06-27 07:22:48 -03:00
ext libstdc++: Make _GLIBCXX_NODISCARD work for C++11 and C++14 2024-11-14 17:00:40 +00:00
lib libstdc++-v3: testsuite: Prune uncapitalized "in function" linker warning 2024-08-16 03:06:53 +02:00
libstdc++-abi
libstdc++-dg
libstdc++-prettyprinters libstdc++: Do not use std::vector<bool>::reference default ctor [PR115098] 2024-08-27 14:20:13 +01:00
libstdc++-xmethods
performance libstdc++: Stop using std::unary_function in perf tests 2024-11-13 17:58:50 +00:00
special_functions
std libstdc++: Implement LWG 3563 changes to keys_view and values_view 2024-11-14 13:27:41 -05:00
tr1 libstdc++: Add dg-error for new -Wdelete-incomplete diagnostics [PR115747] 2024-07-05 12:18:34 +01:00
tr2 libstdc++: Fix std::tr2::dynamic_bitset shift operations [PR115399] 2024-06-12 15:06:47 +01:00
util libstdc++: Fix calculation of system time in performance tests 2024-11-13 20:21:38 +00:00
Makefile.am
Makefile.in