[Issue 24534] Having a label on a declaration makes it possible to skip it with goto

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 3 21:55:31 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24534

--- Comment #4 from Ben <ben.james.jones at gmail.com> ---
Gotta be a bug:

void f2(){ //compiles fine
    int x2;
    goto Label2;
    Dummy2:
    int y2;
    Label2:
    int z2;
}


GotoStatement::semantic() for Label2
goto lastvar: x2
LabelStatement::semantic() for Dummy2
labelstatement lastvar: x2
LabelStatement::semantic() for Label2 
labelstatement lastvar: x2 <--- WRONG, should be y2

--


More information about the Digitalmars-d-bugs mailing list