https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129139
--- Comment #3 from Drea Pinski <pinskia at gcc dot gnu.org> --- (In reply to Peter Shen from comment #2) > If calling the destructor on the > base subobject ends the lifetime of the complete object, then the normal > destruction is also undefined behavior! It depends. For the inheritance case, the subobject destructor is called at the end of the destructor. So there is no undefined behavior there. For the non inheritance case, it is also the same. the whole object destructor is called and then the subobjects. So there is no issue there either. Now the question becomes for the inheritance case, this seems undefined because the object is partial lifetime is gone and creating a newlifetime for the partial object seems very close to being undefined behavior if not already. For the non inheritance (no_unique_address) the lifetime is not fully gone for the full object. There might be a bug there.
