Date: Fri, 01 Aug 2014 10:00:11 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 192303] New: C++11 std::list<>::remove_if() visits elements multiple times Message-ID: <bug-192303-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192303 Bug ID: 192303 Summary: C++11 std::list<>::remove_if() visits elements multiple times Product: Base System Version: 10.0-STABLE Hardware: amd64 OS: Any Status: Needs Triage Severity: Affects Many People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: kamikaze@bsdforen.de Created attachment 145205 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=145205&action=edit Bug demo When calling std::list<>::remove_if() with a lambda for the condition (I did not test without lambdas), it visits the list entry *following* a delete twice. Attached is a demo of the bug. The number of visits should be 10: # ./main Initial list: 0 1 2 3 4 5 6 7 8 9 Remove odd numbers ... | val | remove |-----|-------- | 0 | | 1 | X | 2 | | 2 | | 3 | X | 4 | | 4 | | 5 | X | 6 | | 6 | | 7 | X | 8 | | 8 | | 9 | X Updated list: 0 2 4 6 8 Visits: 14 Build the test program with: # make CXX="c++ -std=c++11" main -- 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-8>