aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/4-statements/decl_for_init_scope.zc
blob: 7d4cae34e7bb4d90f480cdc4cdb5cd02913704bc (plain) (blame)
1
2
3
4
5
// expect error: i is used but never defined
// spec 4.1.8: a for initializer declaration is scoped to the loop
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
fn main() { for (int i = 0; i < 2; i++) { } pn(i); return 0; }