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 */
10 
11 struct S
12 {
13     int v;
funS14     void fun() const     { v++; }
gunS15     void gun() immutable { v++; }
16 }
17 
18 class C
19 {
20     int v;
fun()21     void fun() const     { v++; }
gun()22     void gun() immutable { v++; }
23 }
24