https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106943
--- Comment #31 from Alexander Monakov <amonakov at gcc dot gnu.org> --- (In reply to Xi Ruoyao from comment #28) > "To put it simply, operator delete for class User inspects memory of the > object after the end of its lifetime. This shows as a use-after-dtor error > when running under MemorySanitizer." > > So it seems technically we'll need -fno-lifetime-dse here? Our docs say > -flifetime-dse only "preserve stores before the constructor starts" but > "still treat the object as dead after the destructor". Agreed, -fno-lifetime-dse seems appropriate here. Thank you for proposing a patch on the LLVM side!