[Bug c++/67773] destructor called on temp object before and named object after move, while not being called on named object before move

awenocur at aol dot com gcc-bugzilla@gcc.gnu.org
Wed Sep 30 12:00:00 GMT 2015


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

--- Comment #6 from Adam Wenocur <awenocur at aol dot com> ---
Whoops! Sorry about the malformed double-post.

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, 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.

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?



More information about the Gcc-bugs mailing list