This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/57510] initializer_list memory leak


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!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]