[Bug 192303] C++11 std::list<>::remove_if() visits elements multiple times

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Aug 3 19:40:38 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192303

Dimitry Andric <dim at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Triage                |In Discussion
                 CC|                            |dim at FreeBSD.org

--- Comment #4 from Dimitry Andric <dim at FreeBSD.org> ---
The proposed fix is not correct: when calling erase(i, j), the erased range is
up to, but *not* including j.  Therefore, j must be incremented before calling
erase(), and this will also fix the return value put in i.

This issue also applies to std::list<>::remove().  I have posted an updated
patch to the upstream bug here: http://llvm.org/PR20520 .  If it is accepted
upstream, I will commit it into our version of libc++, and MFC it in 3 days.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-toolchain mailing list