Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/test6883.d

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/test6883.d(15): Error: array index 5 is out of bounds `x[0 .. 5]`
5 fail_compilation/test6883.d(17): Error: array index 7 is out of bounds `x[0 .. 5]`
6 fail_compilation/test6883.d(21): Error: array index 5 is out of bounds `x[0 .. 5]`
7 fail_compilation/test6883.d(23): Error: array index 7 is out of bounds `x[0 .. 5]`
8 ---
9 */
10
11 void main()
12 {
13 {
14 int[5] x;
15 x[x.length] = 1;
16 enum size_t n = 2;
17 x[x.length + n] = 2;
18 }
19 {
20 int[5] x;
21 x[$] = 1;
22 enum size_t n = 2;
23 x[$ + n] = 2;
24 }
25 }