libstdc++: Fix N3344 behavior on _Safe_iterator::_M_can_advance
commitdda96a9d942d73a587e174dd5efe061208a195af
authorFrançois Dumont <fdumont@gcc.gnu.org>
Sun, 17 Mar 2024 18:06:55 +0000 (17 19:06 +0100)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Mon, 18 Mar 2024 21:30:55 +0000 (18 22:30 +0100)
tree7a95f9d2987b623c47237b4c1f5f2f2ab59be7d3
parent5f6e0853c30fec72d977afaa6f7a5633a8d910be
libstdc++: Fix N3344 behavior on _Safe_iterator::_M_can_advance

We shall be able to advance from a 0 offset a value-initialized iterator.

libstdc++-v3/ChangeLog:

* include/debug/safe_iterator.tcc (_Safe_iterator<>::_M_can_advance):
Accept 0 offset advance on value-initialized iterator.
* testsuite/23_containers/vector/debug/n3644.cc: New test case.
libstdc++-v3/include/debug/safe_iterator.tcc
libstdc++-v3/testsuite/23_containers/vector/debug/n3644.cc [new file with mode: 0644]