[PATCH] Fix path::iterator post-increment and post-decrement

Jonathan Wakely jwakely@redhat.com
Sat Oct 21 01:20:00 GMT 2017


On 19/10/17 15:00 +0100, Jonathan Wakely wrote:
>I made a dumb mistake in the post-inc and post-dec operators for
>the path::iterator type, forgetting that _M_cur is sometimes null (for
>a single-element path).
>
>	* include/experimental/bits/fs_path.h (path::iterator++(int))
>	(path::iterator--(int)): Fix for paths with only one component.
>	* testsuite/experimental/filesystem/path/itr/traversal.cc: Test
>	post-increment and post-decrement.

And I made another dumb mistake in the new test, incrementing an end
iterator. It was caught by testing with _GLIBCXX_ASSERTIONS though.

Tested powerpc64le-linux, committed to trunk and gcc-7-branch.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 881 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20171021/75768a25/attachment.bin>


More information about the Libstdc++ mailing list