aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-03-28 21:52:13 +0000
committerJonathan Wakely <jwakely@redhat.com>2020-03-28 21:52:13 +0000
commit42cda3ba45fca30e73e1c35d8e19b5ec8af24d98 (patch)
tree1c6c5cd4868756a8cf29c5fa69256ad95c5d3cb6 /gcc
parent946a444df340609663975c998edc8dfa47284c38 (diff)
downloadgcc-42cda3ba45fca30e73e1c35d8e19b5ec8af24d98.zip
gcc-42cda3ba45fca30e73e1c35d8e19b5ec8af24d98.tar.gz
gcc-42cda3ba45fca30e73e1c35d8e19b5ec8af24d98.tar.bz2
libstdc++: Fix std::reverse_iterator relational operators
My recent changes to reverse_iterator's comparisons was not the version of the code (or tests) that I meant to commit, and broke the relational operators. This fixes them to reverse the order of the comparisons on the base() iterators. This also replaces the SFINAE constraints in the return type of the reverse_iterator and move_iterator comparisons with a requires-clause. This ensures the constrained overloads are preferred to unconstrained ones. This means the non-standard same-type overloads can be omitted for C++20 because they're not needed to solve the problem with std::rel_ops or the testsuite's greedy_ops::X type. * include/bits/stl_iterator.h (reverse_iterator): Use requires-clause to constrain C++20 versions of comparison operators. Fix backwards logic of relational operators. (move_iterator): Use requires-clause to constrain comparison operators in C++20. Do not declare non-standard same-type overloads for C++20. * testsuite/24_iterators/move_iterator/rel_ops_c++20.cc: Check result of comparisons and check using greedy_ops type. * testsuite/24_iterators/reverse_iterator/rel_ops_c++20.cc: Likewise. * testsuite/24_iterators/move_iterator/greedy_ops.cc: Remove redundant main function from compile-only test. * testsuite/24_iterators/reverse_iterator/greedy_ops.cc: Likewise.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions