gcc/libstdc++-v3/include
Jonathan Wakely 979e89a9a9 libstdc++: Fix std::reverse_iterator comparisons (PR 94354)
The std::reverse_iterator comparisons have always been implemented only
in terms of equality and less than. In C++98 that made no difference for
reasonable code, because when the underlying operators are the same type
they are required to support all comparisons anyway.

But since LWG 280 it's possible to compare reverse_iterator<X> and
reverse_iterator<Y>, and comparisons between X and Y might not support
the full set of equality and relational operators. This means that it
matters whether we implement operator!= as x.base() != y.base() or
!(x.base() == y.base()), and the current implementation is
non-conforming.

This was already fixed in GCC 10.1 for C++20, this change also fixes it
for all other -std modes.

	PR libstdc++/94354
	* include/bits/stl_iterator.h (reverse_iterator): Fix comparison
	operators to use the correct operations on the underlying
	iterators.
	* testsuite/24_iterators/reverse_iterator/rel_ops.cc: New test.
2020-05-27 21:58:56 +01:00
..
backward
bits libstdc++: Fix std::reverse_iterator comparisons (PR 94354) 2020-05-27 21:58:56 +01:00
c
c_compatibility
c_global
c_std
debug libstdc++: Fix function that can't be constexpr in C++11 (PR 95289) 2020-05-23 18:27:35 +01:00
decimal
experimental libstdc++: Refactor filesystem::path string conversions 2020-05-23 09:40:16 +01:00
ext
parallel
precompiled
pstl
std Implent C++20 std::atomic_flag::test 2020-05-12 07:37:09 +02:00
tr1
tr2
Makefile.am
Makefile.in