mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
Fix Issue 23271 - Mark lowered DeclExps in array appends as exptemp (#14328)
This commit is contained in:
parent
5843effb01
commit
0f2c2e8b60
2 changed files with 19 additions and 0 deletions
17
compiler/test/compilable/testgotoskips.d
Normal file
17
compiler/test/compilable/testgotoskips.d
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
Tests to defend against false positives from the goto skips over decl errors
|
||||
*/
|
||||
// https://issues.dlang.org/show_bug.cgi?id=23271
|
||||
class A {
|
||||
private static A[] active;
|
||||
private void test() {
|
||||
foreach(a; active) {
|
||||
if(a is this)
|
||||
goto label;
|
||||
}
|
||||
// used to say Error: `goto` skips declaration of variable `s.A.test.__appendtmp4` at s.d(...)
|
||||
active ~= this;
|
||||
label:
|
||||
return;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue