summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail2195.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/fail2195.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fail2195.d16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail2195.d b/gcc/testsuite/gdc.test/fail_compilation/fail2195.d
index b6d53042109..0eff0663d4b 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail2195.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail2195.d
@@ -16,3 +16,19 @@ void main()
int variable; // shadowing is disallowed but not detected
}
}
+
+void fun()
+{
+ int var1, var2, var3;
+
+ void gun()
+ {
+ int var1; // OK?
+
+ int[] arr;
+ foreach (i, var2; arr) {} // OK?
+
+ int[int] aa;
+ foreach (k, var3; aa) {} // Not OK??
+ }
+}