[PATCH] PR78346 make <bits/predefined_ops.h> handle stashing iterators

Jonathan Wakely jwakely@redhat.com
Wed Feb 1 12:57:00 GMT 2017


I didn't get an answer explaining why these function objects store a
reference not the iterator, so I'm fixing the regression by storing
the iterator and dereferencing it on every comparison.

	PR libstdc++/78346
	* include/bits/predefined_ops.h (_Iter_equals_iter): Store iterator
	not its referent.
	(_Iter_comp_to_iter): Likewise.
	* testsuite/25_algorithms/search/78346.cc: New test.

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


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


More information about the Libstdc++ mailing list