https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67773
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Adam Wenocur from comment #6) > Another way of explaining the problem is that the compiler appears to be > suppressing the wrong destructor call. Since this is a move and not a copy, > or in C++03 it's a copy elision, No, you can't elide an assignment to an existing variable. > it should be suppressing the destructor > call on the temporary variable. It's not doing this though; it's > suppressing the first destructor call on the named variable instead. No, that's not how C++ works. > When I get a chance, I'll build a GCC for testing purposes. What version > would be appropriate in this case? Is 4.8.5 supported? No, the currently supported versions are listed on the home page, https://gcc.gnu.org/ The oldest supported release is 4.9.3