https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66139
--- Comment #2 from Tomasz KamiĆski <tomaszkam at gmail dot com> --- Example of some real life safe-code (now raw allocations, STL container used), that is leaking: #include <string> #include <vector> #include <iostream> using namespace std; struct Test { string a; string b; }; Test make_test() { vector<string> strings {"123456789abcdef0"}; return Test { strings.at(0), strings.at(2) // throws; the destructor for a copy of strings.at(0) is not called and memory leakds }; } int main() { try { Test test = make_test(); } catch (exception &e) { cerr << e.what() << endl; } } Live code proving leaks: https://wandbox.org/permlink/GjjxFw9jAE9bfvyS