diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-12-09 22:22:42 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-12-09 23:19:03 +0000 |
commit | 2c7fb16b5283cf90c4a7f7470e91e1010ee80fcc (patch) | |
tree | 6d1c7f042ac1628d654528582fe02310903f4d75 /libphobos/src/std/algorithm | |
parent | 9042302ef06dc8484ee188ebd6c4164ba67d347d (diff) | |
download | gcc-2c7fb16b5283cf90c4a7f7470e91e1010ee80fcc.zip gcc-2c7fb16b5283cf90c4a7f7470e91e1010ee80fcc.tar.gz gcc-2c7fb16b5283cf90c4a7f7470e91e1010ee80fcc.tar.bz2 |
libstdc++: Fix ambiguous comparisons for iterators in C++20
Since r11-1571 (c++: Refinements to "more constrained") was changed in
the front end, the following comment from stl_iterator.h stopped being
true:
// These extra overloads are not needed in C++20, because the ones above
// are constrained with a requires-clause and so overload resolution will
// prefer them to greedy unconstrained function templates.
The requires-clause is no longer considered when comparing unrelated
function templates. That means that the constrained operator== specified
in the standard is no longer more constrained than the pathological
comparison operators defined in the testsuite_greedy_ops.h header. This
was causing several tests to FAIL in C++20 mode:
FAIL: 23_containers/deque/types/1.cc (test for excess errors)
FAIL: 23_containers/vector/types/1.cc (test for excess errors)
FAIL: 24_iterators/move_iterator/greedy_ops.cc (test for excess errors)
FAIL: 24_iterators/normal_iterator/greedy_ops.cc (test for excess errors)
FAIL: 24_iterators/reverse_iterator/greedy_ops.cc (test for excess errors)
The solution is to restore some of the non-standard comparison operators
that are more specialized than the greedy operators in the testsuite.
libstdc++-v3/ChangeLog:
* include/bits/stl_iterator.h (operator==, operator<=>): Define
overloads for homogeneous specializations of reverse_iterator,
__normal_iterator and move_iterator.
Diffstat (limited to 'libphobos/src/std/algorithm')
0 files changed, 0 insertions, 0 deletions