https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121475
--- Comment #2 from Andrew Benson <abensonca at gcc dot gnu.org> --- (In reply to Jerry DeLisle from comment #1) > This one I am not so sure why the destructor should be called right after > the assignment. I will have to defer to others to comment. My understanding is that when we have: i=rm() there should first be a destructor call on i. This is followed by the function call rm(), which returns an object of type(rm). This object is then assigned to i. Lastly, this object (i.e. the one returned by the rm() call), should be finilized.