[Bug libstdc++/115799] ranges::find's optimized branching for memchr is not quite right
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jul 7 11:29:31 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115799
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:762ee55d369a3257997092ef7853cf9dd4d5cc4f
commit r15-1879-g762ee55d369a3257997092ef7853cf9dd4d5cc4f
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Jul 5 18:58:00 2024 +0100
libstdc++: Fix memchr path in std::ranges::find for non-common range
[PR115799]
The memchr optimization introduced in r15-1857 needs to advance the
start iterator instead of returning the sentinel.
libstdc++-v3/ChangeLog:
PR libstdc++/115799
* include/bits/ranges_util.h (__find_fn): Return iterator
instead of sentinel.
* testsuite/25_algorithms/find/constrained.cc: Check non-common
contiguous sized range of char.
More information about the Gcc-bugs
mailing list