https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106965
--- Comment #2 from Boaz <olddra3rd at mozmail dot com> --- (In reply to Richard Biener from comment #1) > I think it's undefined to invoke a DTOR twice which is what you do here. > After the DTOR the m_ptr member becomes undefined so re-evaluating that in > the second invocation (when there's no object of type X anymore) is > undefined. Damn, you're right. Was told it's legal, but upon further check seems I was wrong. Cheers and thanks.