comparison gcc/testsuite/gdc.test/fail_compilation/fail2195.d @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 // https://issues.dlang.org/show_bug.cgi?id=2195
2 // REQUIRED_ARGS: -de
3 /*
4 TEST_OUTPUT:
5 ---
6 fail_compilation/fail2195.d(16): Deprecation: variable `variable` is shadowing variable `fail2195.main.variable`. Rename the `foreach` variable.
7 ---
8 */
9
10 void main()
11 {
12 int[int] arr;
13 int variable;
14 foreach (i, j; arr)
15 {
16 int variable; // shadowing is disallowed but not detected
17 }
18 }