gcc/libstdc++-v3/testsuite/25_algorithms
Jonathan Wakely 0fd9e8482e PR libstdc++/90920 restore previous checks for empty ranges
The change in r263433 broke the contract of the __rotate functions, by no
longer accepting empty ranges. That means that callers which inlined the
old version of std::rotate (without checks) that end up linking to a new
definition of std::__rotate (also without checks) could perform a divide
by zero and crash.

This restores the old contract of the __rotate overloads.

	PR libstdc++/90920 partially revert r263433
	* include/bits/stl_algo.h (__rotate): Restore checks for empty ranges.
	(rotate): Remove checks.
	* testsuite/25_algorithms/rotate/90920.cc: New test.

From-SVN: r272489
2019-06-19 23:57:02 +01:00
..
adjacent_find
advance/istreambuf_iterators
all_of
any_of
binary_search Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00
clamp
copy
copy_backward
copy_if
copy_n
count
count_if
equal
equal_range Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00
fill
fill_n PR libstdc++/87982 Fix generate_n and fill_n use of _Size parameter 2019-04-29 13:12:43 +01:00
find
find_end
find_first_of
find_if
find_if_not
for_each Implement new serial algorithms from Parallelism TS (P0024R2) 2019-06-19 00:01:16 +01:00
generate/requirements/explicit_instantiation
generate_n PR libstdc++/87982 Fix generate_n and fill_n use of _Size parameter 2019-04-29 13:12:43 +01:00
headers
heap
includes
inplace_merge
is_heap
is_heap_until
is_partitioned
is_permutation
is_sorted
is_sorted_until
iter_swap
lexicographical_compare Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00
lower_bound Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00
make_heap
max
max_element
merge
min
min_element
minmax
minmax_element
mismatch
move
move_backward
next_permutation
none_of
nth_element
partial_sort
partial_sort_copy
partition
partition_copy
partition_point
pop_heap
prev_permutation
pstl Fix incorrect __cpp_lib_parallel_algorithm macro definitions 2019-06-12 21:16:03 +01:00
push_heap
random_shuffle
remove
remove_copy/requirements/explicit_instantiation
remove_copy_if
remove_if
replace
replace_copy
replace_copy_if
replace_if
reverse
reverse_copy/explicit_instantiation
rotate PR libstdc++/90920 restore previous checks for empty ranges 2019-06-19 23:57:02 +01:00
rotate_copy/requirements/explicit_instantiation
sample
search
search_n
set_difference
set_intersection
set_symmetric_difference
set_union
shuffle
sort
sort_heap
stable_partition
stable_sort
swap
swap_ranges
transform/requirements/explicit_instantiation
unique
unique_copy
upper_bound Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00