https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115447
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- > Putting the variable inside this block does not change the semantics of the > function YES it does, the side effect of the dtor happens after bar in the original case and before bar in the second case. They could have side effects on global memory that is outside of what the front-end knows.