Bug 23271 – `goto` skips declaration of variable `bugred.A.test.__appendtmp4`

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-07-25T13:24:49Z
Last change time
2022-07-26T06:38:16Z
Keywords
pull
Assigned to
No Owner
Creator
Adam D. Ruppe

Comments

Comment #0 by destructionator — 2022-07-25T13:24:49Z
dmd master broke this code: --- class A { private static A[] active; private void test() { foreach(a; active) if(a is this) goto label; active ~= this; label: return; } } --- bugred.d(6): Error: `goto` skips declaration of variable `bugred.A.test.__appendtmp4` at bugred.d(7)
Comment #1 by dlang-bot — 2022-07-25T13:49:53Z
@maxhaton created dlang/dmd pull request #14328 "Fix Issue 23271 - Mark lowered DeclExps in array appends as exptemp" fixing this issue: - Fix Issue 23271 - Mark lowered DeclExps in array appends as exptemp https://github.com/dlang/dmd/pull/14328
Comment #2 by dlang-bot — 2022-07-26T06:38:16Z
dlang/dmd pull request #14328 "Fix Issue 23271 - Mark lowered DeclExps in array appends as exptemp" was merged into master: - 5e0d4f72c423a351bf5ab4a137cef5232d82c042 by mhh: Fix Issue 23271 - Mark lowered DeclExps in array appends as exptemp https://github.com/dlang/dmd/pull/14328