https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103993
--- Comment #4 from Ed Catmur <ed at catmur dot uk> --- And another example, provoked by throwing new (this only happens at -Og): #include <cstdlib> struct D { D(); static void* operator new (std::size_t s) { if (void* p = ::malloc(s)) return p; throw "bad_alloc"; } static void operator delete (void* p) { ::free(p); } }; int main() { new D; }