]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail351.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail351.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail351.d(14): Error: cast(uint)this.num[index] is not an lvalue
5 ---
6 */
7
8 // 2780
9
10 struct Immutable {
11 immutable uint[2] num;
12
13 ref uint opIndex(size_t index) immutable {
14 return num[index];
15 }
16 }
17
18 void main() {
19 immutable Immutable foo;
20 //foo[0]++;
21 }