4 // Disallow skipping variable decl
5 static assert(!__traits(compiles
, (bool b
)
13 // Disallow skipping variable in block backwards
14 static assert(!__traits(compiles
, (bool b
)
24 // Disallow skipping backwards int block
25 static assert(!__traits(compiles
, (bool b
)
35 // Variable inside try block
36 static assert(!__traits(compiles
, (bool b
)
50 // Variable inside catch block
51 static assert(!__traits(compiles
, (bool b
)
65 // Goto into catch block with unnamed exception
66 static assert(__traits(compiles
, (bool b
)
78 // Goto into catch block with named exception
79 static assert(!__traits(compiles
, (bool b
)
92 // Goto into finally block
93 static assert(!__traits(compiles
, (bool b
)
105 // Goto into variable with block
106 static assert(!__traits(compiles
, (bool b
)
120 // Goto backwards into variable with block
121 static assert(!__traits(compiles
, (bool b
)
135 // Goto into symbolic with block
136 static assert(__traits(compiles
, (bool b
)
149 // Goto backwards into symbolic with block
150 static assert(__traits(compiles
, (bool b
)
163 // Goto into for loop
164 static assert(!__traits(compiles
, (bool b
)
167 for (int i
= 0; i
< 8; ++i
)
174 // Goto into for loop backwards
175 static assert(!__traits(compiles
, (bool b
)
177 for (int i
= 0; i
< 8; ++i
)
185 // Goto into foreach loop
186 static assert(!__traits(compiles
, (bool b
)
196 // Goto into foreach loop backwards
197 static assert(!__traits(compiles
, (bool b
)
207 // Goto into if block with variable
208 static assert(!__traits(compiles
, (bool b
)
218 // Goto backwards into if block with variable
219 static assert(!__traits(compiles
, (bool b
)
229 // Goto into if block without variable
230 static assert(__traits(compiles
, (bool b
)
239 // Goto into else block
240 static assert(__traits(compiles
, (bool b
)
252 // Goto backwards into else with variable
253 static assert(!__traits(compiles
, (bool b
)
266 // Goto into while block
267 static assert(__traits(compiles
, (bool b
)
276 // Goto into while block with internal variable
277 static assert(!__traits(compiles
, (bool b
)
288 // Goto into do block
289 static assert(__traits(compiles
, (bool b
)
299 // Goto over switch variable
300 static assert(!__traits(compiles
, (bool b
)
312 // Goto over switch variable
313 static assert(!__traits(compiles
, (bool b
)
326 // Goto into synchronized statement
327 static assert(!__traits(compiles
, (bool b
)
337 // Goto into scope(success) with variable
338 static assert(!__traits(compiles
, (bool b
)
340 scope(success
) { int x
; label
: {} assert(!x
); }
345 // Goto into scope(failure)
346 static assert(!__traits(compiles
, (bool b
)
350 scope(failure
) { label
: {} }
353 // Goto into scope(failure) with variable
354 static assert(!__traits(compiles
, (bool b
)
356 scope(failure
) { int x
; label
: {} assert(!x
); }
361 // Goto into scope(exit)
362 static assert(!__traits(compiles
, (bool b
)
366 scope(exit
) { label
: {} }
369 // Goto into scope(exit)
370 static assert(!__traits(compiles
, (bool b
)
372 scope(exit
) { label
: {} }
377 // Goto into scope(exit) with variable
378 static assert(!__traits(compiles
, (bool b
)
380 scope(exit
) { int x
; label
: {} assert(!x
); }
385 /***************************************************/
386 // https://issues.dlang.org/show_bug.cgi?id=11659
396 /***************************************************/
397 // https://issues.dlang.org/show_bug.cgi?id=13321
399 void test13321(bool b
)