https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77312
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I don't see why you think this is valid thing to do. You are in a function which calls delete on the object you are in currently. That seems like this code is broken.