This is an archive of the discontinued LLVM Phabricator instance.

Implement N3644 "Null Forward Pointers" in _LIBCPP_DEBUG mode.
ClosedPublic

Authored by Quuxplusone on Apr 20 2021, 11:58 AM.

Details

Summary

This functionality is already tested in std/containers/sequences/vector/iterators.pass.cpp.
It was not tested in string.iter/iterators.pass.cpp, so I've also added a test there (and refactored the original to reduce tedium). The added test fails before this patch.

list has debug iterators, but it's not random-access (so it has no </<= operators to be affected by this patch).
deque is random-access, but it doesn't have debug iterators (so it is unaffected by this patch).

This came, obliquely, out of D100866. Fixing this test now means I won't have to mark it XFAILed in debug mode because it no longer fails.

Diff Detail

Event Timeline

Quuxplusone requested review of this revision.Apr 20 2021, 11:58 AM
Quuxplusone created this revision.
Herald added a reviewer: Restricted Project. · View Herald TranscriptApr 20 2021, 11:58 AM

@ldionne ping for a second libc++ approval!

ldionne accepted this revision.Apr 23 2021, 9:38 AM

Do you know why the test in std/containers/sequences/vector/iterators.pass.cpp didn't fail before this patch? Thanks for fixing.

This revision is now accepted and ready to land.Apr 23 2021, 9:38 AM

Do you know why the test in std/containers/sequences/vector/iterators.pass.cpp didn't fail before this patch?

IIUYQC, @ldionne, that test did fail... but only in debug_level=1 mode, which we don't buildkite yet. It is one of the tests I had to annotate in D100866 (but now I won't have to).