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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Specifically, a move assignment doesn't destroy anything, it just performs an
assignment. So the named variable is not destroyed, its move assignment
operator is called, which does whatever it is written to do. The temporary is
destroyed at the end of the expression, moving from it doesn't alter its
lifetime in any way. The named variable is destroyed at the end of the block as
usual, move assigning to it doesn't alter its lifetime in any way.

There are online compilers you can use to check the results from various GCC
and Clang releases, e.g. http://melponlorg/wandbox

You will find none of them runs a destructor on the target of a move
assignment, because that's not how C++ works.

Reply via email to