gcc/libstdc++-v3/include/bits
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
..
algorithmfwd.h
alloc_traits.h libstdc++: Avoid errors in allocator's noexcept-specifier (PR 89510) 2020-04-30 16:01:43 +01:00
allocated_ptr.h
allocator.h libstdc++: Avoid errors in allocator's noexcept-specifier (PR 89510) 2020-04-30 16:01:43 +01:00
atomic_base.h Implent C++20 std::atomic_flag::test 2020-05-12 07:37:09 +02:00
atomic_futex.h
basic_ios.h
basic_ios.tcc
basic_string.h libstdc++: Add comparison operators for string and regex types 2020-04-17 16:40:11 +01:00
basic_string.tcc libstdc++: Fix outdated comment about std::string instantiations (PR 94854) 2020-04-29 19:00:58 +01:00
boost_concept_check.h
c++0x_warning.h
c++config
char_traits.h libstdc++: Add comparison operators for string and regex types 2020-04-17 16:40:11 +01:00
charconv.h
codecvt.h
concept_check.h
cpp_type_traits.h
deque.tcc
enable_special_members.h
erase_if.h
forward_list.h libstdc++: Add comparison operators to sequence containers 2020-04-17 23:41:04 +01:00
forward_list.tcc
fs_dir.h libstdc++: Add comparison operators to std::filesystem types 2020-04-15 21:01:42 +01:00
fs_fwd.h libstdc++: Add comparison operators to std::filesystem types 2020-04-15 21:01:42 +01:00
fs_ops.h
fs_path.h libstdc++: Refactor filesystem::path string conversions 2020-05-23 09:40:16 +01:00
fstream.tcc
functexcept.h
functional_hash.h
gslice_array.h
gslice.h
hashtable_policy.h
hashtable.h
indirect_array.h
int_limits.h
invoke.h
ios_base.h
istream.tcc
iterator_concepts.h libstdc++: Avoid constraint recursion with iterator_traits (PR 93983) 2020-05-21 07:32:15 +01:00
list.tcc
locale_classes.h libstdc++: Add comparison operators to types from Utilities clause 2020-04-15 19:47:48 +01:00
locale_classes.tcc
locale_conv.h
locale_facets_nonio.h
locale_facets_nonio.tcc
locale_facets.h
locale_facets.tcc
localefwd.h
mask_array.h
memoryfwd.h
move.h
node_handle.h
ostream_insert.h
ostream.tcc
parse_numbers.h
postypes.h
predefined_ops.h
ptr_traits.h libstdc++: Add missing feature test macros 2020-04-22 22:54:34 +01:00
quoted_string.h
random.h
random.tcc
range_access.h libstdc++: Add missing feature test macros 2020-04-22 22:54:34 +01:00
range_cmp.h libstdc++: Define __cpp_lib_ranges macro for C++20 2020-03-27 23:26:03 +00:00
ranges_algo.h libstdc++: Fix some C++20 algorithms to work in parallel mode 2020-05-07 21:43:49 +01:00
ranges_algobase.h
ranges_uninitialized.h
refwrap.h
regex_automaton.h
regex_automaton.tcc
regex_compiler.h
regex_compiler.tcc
regex_constants.h
regex_error.h
regex_executor.h
regex_executor.tcc
regex_scanner.h
regex_scanner.tcc
regex.h libstdc++: Add comparison operators for string and regex types 2020-04-17 16:40:11 +01:00
regex.tcc
shared_ptr_atomic.h
shared_ptr_base.h libstdc++: Add comparison operators to std::shared_ptr (PR 94562) 2020-04-14 21:54:55 +01:00
shared_ptr.h libstdc++: Add comparison operators to std::shared_ptr (PR 94562) 2020-04-14 21:54:55 +01:00
slice_array.h libstdc++: Add comparison operators to types from Numerics clause 2020-04-08 16:51:59 +01:00
specfun.h
sstream.tcc
std_abs.h
std_function.h libstdc++: Add comparison operators to types from Utilities clause 2020-04-15 19:47:48 +01:00
std_mutex.h
stl_algo.h
stl_algobase.h libstdc++: Fix some C++20 algorithms to work in parallel mode 2020-05-07 21:43:49 +01:00
stl_bvector.h libstdc++ std::fill overload for std::vector<bool>::iterator 2020-05-06 23:28:22 +02:00
stl_construct.h libstdc++: Fix regression in std::_Construct (PR 94831) 2020-04-28 23:39:38 +01:00
stl_deque.h libstdc++: Add comparison operators to sequence containers 2020-04-17 23:41:04 +01:00
stl_function.h
stl_heap.h
stl_iterator_base_funcs.h
stl_iterator_base_types.h libstdc++: Define __cpp_lib_ranges macro for C++20 2020-03-27 23:26:03 +00:00
stl_iterator.h libstdc++: Fix std::reverse_iterator comparisons (PR 94354) 2020-05-27 21:58:56 +01:00
stl_list.h libstdc++: Add comparison operators to sequence containers 2020-04-17 23:41:04 +01:00
stl_map.h libstdc++: Remove non-standard feature test macros 2020-04-22 22:54:34 +01:00
stl_multimap.h libstdc++: Add comparison operators to associative containers 2020-04-20 17:50:10 +01:00
stl_multiset.h libstdc++: Add comparison operators to associative containers 2020-04-20 17:50:10 +01:00
stl_numeric.h
stl_pair.h libstdc++: Fixes for feature test macros (PR 91480) 2020-04-28 23:40:18 +01:00
stl_queue.h libstdc++: Define operator<=> for std::stack and std::queue 2020-04-19 21:30:15 +01:00
stl_raw_storage_iter.h
stl_relops.h
stl_set.h libstdc++: Add comparison operators to associative containers 2020-04-20 17:50:10 +01:00
stl_stack.h libstdc++: Define operator<=> for std::stack and std::queue 2020-04-19 21:30:15 +01:00
stl_tempbuf.h
stl_tree.h libstdc++: Add comparison operators to associative containers 2020-04-20 17:50:10 +01:00
stl_uninitialized.h
stl_vector.h libstdc++: Add comparison operators to sequence containers 2020-04-17 23:41:04 +01:00
stream_iterator.h
streambuf_iterator.h
streambuf.tcc
string_view.tcc
stringfwd.h
uniform_int_dist.h
unique_lock.h
unique_ptr.h libstdc++: Add comparison operators to std::shared_ptr (PR 94562) 2020-04-14 21:54:55 +01:00
unordered_map.h libstdc++: Remove non-standard feature test macros 2020-04-22 22:54:34 +01:00
unordered_set.h libstdc++: Remove operator!= overloads for unordered containers 2020-04-19 21:05:32 +01:00
uses_allocator.h
valarray_after.h
valarray_array.h
valarray_array.tcc
valarray_before.h
vector.tcc