-
libstdc++: Always return a sentinel<I> from __gnu_test::test_range::end() · 6e5a1963
It seems that in practice std::sentinel_for<I, I> is always true, and so the test_range container doesn't help us detect bugs in ranges code in which we wrongly assume that a sentinel can be manipulated like an iterator. Make the test_range range more strict by having end() unconditionally return a sentinel<I>, and adjust some tests accordingly. libstdc++-v3/ChangeLog: * testsuite/24_iterators/range_operations/distance.cc: Do not assume test_range::end() returns the same type as test_range::begin(). * testsuite/24_iterators/range_operations/next.cc: Likewise. * testsuite/24_iterators/range_operations/prev.cc: Likewise. * testsuite/util/testsuite_iterators.h (__gnu_test::test_range::end): Always return a sentinel<I>.
Patrick Palka committed
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| advance.cc | Loading commit data... | |
| advance_debug_neg.cc | Loading commit data... | |
| distance.cc | Loading commit data... | |
| next.cc | Loading commit data... | |
| prev.cc | Loading commit data... |