[Bug c++/57510] initializer_list memory leak

tavianator at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Dec 8 21:03:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57510

--- Comment #4 from Tavian Barnes <tavianator at gmail dot com> ---
I have a testing tool that automatically inserts operator new failures, to help
test exception safety and check for leaks.  This bug causes all kinds of
spurious failures that I have to work around, since anything like this

    vector<string> vec = {"some", "strings"};

leaks memory if the second string constructor fails.  Usually it can be worked
around like this

    string arr[] = {"some", "strings"};

but it's still quite annoying.

If someone can point me in the right direction or give an outline of how to fix
this bug, I'm happy to try and write up a patch myself.  Thanks!



More information about the Gcc-bugs mailing list