Bug 22995 – goto case cannot forward to outer case label

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-07T12:47:47Z
Last change time
2024-12-13T19:22:10Z
Assigned to
No Owner
Creator
moonlightsentinel
Moved to GitHub: dmd#20086 →

Comments

Comment #0 by moonlightsentinel — 2022-04-07T12:47:47Z
Forward-references to a case inside the same switch works: void foo(int i, int j) { final switch (i) { case 1: break; case 2: final switch (j) { case 4: goto case 3; case 3: break; } break; } } But fails if the forward-referenced case belongs to an enclosing switch statement: void foo(int i, int j) { final switch (i) { case 1: break; case 2: final switch (j) { case 4: // goto case 1; // ok goto case 3; // fails } break; case 3: break; } }
Comment #1 by robert.schadek — 2024-12-13T19:22:10Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20086 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB