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++/67773] destructor called on temp object before and named object after move, while not being called on named object before move


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?


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