http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60371
--- Comment #3 from Дилян Палаузов <dilyan.palauzov at aegee dot org> --- Indeed, adding z (const z& x) { var = strdup (x.var); } solves the problem. However, I don't understand how that "y.clear();" between the y.emplace_back() in the original program avoids the double free.