Bug 22933 – importC: goto skips declaration of variable

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-03-25T12:45:12Z
Last change time
2022-03-29T19:26:52Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
duser

Comments

Comment #0 by duser — 2022-03-25T12:45:12Z
void fn() { goto L; int x = 1; L: return; } Error: `goto` skips declaration of variable `test.fn.x` at test.c(4) could this be allowed in importC? other compilers accept it when compiling C but not C++
Comment #1 by dlang-bot — 2022-03-29T06:16:52Z
@WalterBright created dlang/dmd pull request #13913 "fix Issue 22933 - importC: goto skips declaration of variable" fixing this issue: - fix Issue 22933 - importC: goto skips declaration of variable https://github.com/dlang/dmd/pull/13913
Comment #2 by dlang-bot — 2022-03-29T19:26:52Z
dlang/dmd pull request #13913 "fix Issue 22933 - importC: goto skips declaration of variable" was merged into master: - cd51b32e3c452e3a366430ed22ff7e006483dc9e by Walter Bright: fix Issue 22933 - importC: goto skips declaration of variable https://github.com/dlang/dmd/pull/13913