https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114357
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-03-16 Status|UNCONFIRMED |NEW --- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- e.g. PR 107500 where a bare metal system wastes space for a no-op destructor. It would be a lot simpler if we could just mark immortal objects as [[no_destroy]] and not have to dance around what the standard allows (or not) about lifetimes and triviality for objects with static storage duration. It would also be better to not rely on DCE being able to figure out what we're trying to do with unions and empty destructors. There are valid use cases in a kernel or language runtime for ensuring that some objects do not end their lifetime while other code is still running.