On Tuesday, 6 November 2018 at 00:13:52 UTC, Stanislav Blinov wrote:
But here it's fine:

void main(){
     {
         goto Q;
         S x;
     } // <---
     Q:
     writeln("a");
}

because goto jumps over both initialization *and* destruction, i.e. neither would even be performed.

I see but at same time I found a bit confusing, because in this case we're just adding a new scope to fix the issue, and like I said to Jonathan, I thought that "x" wouldn't be initialized since it is never used.

Thanks,

MatheusBN.

Reply via email to