Date: Sun, 03 Aug 2014 19:40:38 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-toolchain@FreeBSD.org Subject: [Bug 192303] C++11 std::list<>::remove_if() visits elements multiple times Message-ID: <bug-192303-29464-MdeaRmgnHZ@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-192303-29464@https.bugs.freebsd.org/bugzilla/> References: <bug-192303-29464@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192303 Dimitry Andric <dim@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Triage |In Discussion CC| |dim@FreeBSD.org --- Comment #4 from Dimitry Andric <dim@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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-192303-29464-MdeaRmgnHZ>