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.