gcc/libstdc++-v3/testsuite/24_iterators/range_operations
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
..
100768.cc
advance_debug_neg.cc
advance.cc libstdc++: Fix return value of std::ranges::advance [PR 100833] 2021-06-01 17:09:06 +01:00
distance.cc
next.cc
prev.cc