d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / diag12777.d
blobdd4321bb3ffe85a7c92a55779b17d405164feacb
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag12777.d(14): Error: cannot modify `this.v` in `const` function
5 fail_compilation/diag12777.d(15): Error: cannot modify `this.v` in `immutable` function
6 fail_compilation/diag12777.d(21): Error: cannot modify `this.v` in `const` function
7 fail_compilation/diag12777.d(22): Error: cannot modify `this.v` in `immutable` function
8 ---
9 */
11 struct S
13 int v;
14 void fun() const { v++; }
15 void gun() immutable { v++; }
18 class C
20 int v;
21 void fun() const { v++; }
22 void gun() immutable { v++; }