]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail110.d
VAX/doc: Fix issues with FP format option documentation
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail110.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail110.d(19): Error: variable `i` is shadowing variable `fail110.main.i`
5 fail_compilation/fail110.d(17): declared here
6 fail_compilation/fail110.d(20): Error: variable `i` is shadowing variable `fail110.main.i`
7 fail_compilation/fail110.d(17): declared here
8 fail_compilation/fail110.d(21): Error: variable `i` is shadowing variable `fail110.main.i`
9 fail_compilation/fail110.d(17): declared here
10 ---
11 */
12
13 // https://issues.dlang.org/show_bug.cgi?id=297
14 // Shadowing declarations allowed in foreach type lists
15 void main()
16 {
17 int i;
18 int[] a;
19 foreach (i; a) {}
20 foreach (size_t i, n; a) {}
21 for (int i;;) {}
22 }