This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/63698] [5 Regression] std::set leaks nodes on assignment
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 31 Oct 2014 11:45:34 +0000
- Subject: [Bug libstdc++/63698] [5 Regression] std::set leaks nodes on assignment
- Auto-submitted: auto-generated
- References: <bug-63698-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Created attachment 33853
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33853&action=edit
try to fix leak
The rightmost node is not necessarily a leaf, so set _M_nodes to
_M_rightmost()->_M_left if that exists.
Also simplify the constructor as it only needs one argument.