gcc/libstdc++-v3/testsuite/24_iterators
Jonathan Wakely d832629169 libstdc++: Fix return value of std::ranges::advance [PR 100833]
The three-argument form of ranges::advance is supposed to return the
difference between the second argument and the distance the iterator was
advanced. When a non-random-access iterator is not advanced (because it
already equals the sentinel) we were returning 0 rather than n - 0.

libstdc++-v3/ChangeLog:

	PR libstdc++/100833
	* include/bits/ranges_base.h (ranges::advance(iter, n, sentinel)):
	Fix return value for no-op case.
	* testsuite/24_iterators/range_operations/advance.cc: Test
	return values of three-argument overload.
2021-06-01 17:09:06 +01:00
..
associated_types Update copyright years. 2021-01-04 10:26:59 +01:00
back_insert_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
bidirectional Update copyright years. 2021-01-04 10:26:59 +01:00
common_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
contiguous Update copyright years. 2021-01-04 10:26:59 +01:00
counted_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
customization_points Update copyright years. 2021-01-04 10:26:59 +01:00
forward Update copyright years. 2021-01-04 10:26:59 +01:00
front_insert_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
headers/iterator libstdc++: Change [range.iter.op] functions to function objects [PR 100768] 2021-05-26 19:15:34 +01:00
indirect_callable Update copyright years. 2021-01-04 10:26:59 +01:00
input Update copyright years. 2021-01-04 10:26:59 +01:00
insert_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
istream_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
istreambuf_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
move_iterator libstdc++: Implement LWG 3391 changes to move/counted_iterator::base() 2021-05-06 09:11:42 -04:00
normal_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
operations Update copyright years. 2021-01-04 10:26:59 +01:00
ostream_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
ostreambuf_iterator Update copyright years. 2021-01-04 10:26:59 +01:00
output Update copyright years. 2021-01-04 10:26:59 +01:00
random_access Update copyright years. 2021-01-04 10:26:59 +01:00
range_access libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-10 16:22:54 +01:00
range_operations libstdc++: Fix return value of std::ranges::advance [PR 100833] 2021-06-01 17:09:06 +01:00
reverse_iterator libstdc++: Implement missing P0896R4 changes to reverse_iterator [PR100639] 2021-05-20 14:08:17 -04:00
aliases.cc Update copyright years. 2021-01-04 10:26:59 +01:00
container_access.cc libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-10 16:22:54 +01:00