aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2020-01-21 17:00:43 -0500
committerPatrick Palka <ppalka@redhat.com>2020-01-31 12:17:10 -0500
commit6e5a196399d4393f30f2617f6fc042f2e94730b0 (patch)
tree5a02ad819e4c2b3bcfa4184195b80398c4a3da18 /gcc
parentb92709388b9aee52db3cd7c227818e0ecccda2e5 (diff)
downloadgcc-6e5a196399d4393f30f2617f6fc042f2e94730b0.zip
gcc-6e5a196399d4393f30f2617f6fc042f2e94730b0.tar.gz
gcc-6e5a196399d4393f30f2617f6fc042f2e94730b0.tar.bz2
libstdc++: Always return a sentinel<I> from __gnu_test::test_range::end()
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>.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions