Debian Codegraph @

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

raw
1 // REQUIRED_ARGS: -o-
2 /*
3 TEST_OUTPUT:
4 ---
5 fail_compilation/fail9199.d(13): Error: function `fail9199.fc` without `this` cannot be `const`
6 fail_compilation/fail9199.d(14): Error: function `fail9199.fi` without `this` cannot be `immutable`
7 fail_compilation/fail9199.d(15): Error: function `fail9199.fw` without `this` cannot be `inout`
8 fail_compilation/fail9199.d(16): Error: function `fail9199.fs` without `this` cannot be `shared`
9 fail_compilation/fail9199.d(17): Error: function `fail9199.fsc` without `this` cannot be `shared const`
10 fail_compilation/fail9199.d(18): Error: function `fail9199.fsw` without `this` cannot be `shared inout`
11 ---
12 */
13 void fc() const {}
14 void fi() immutable {}
15 void fw() inout {}
16 void fs() shared {}
17 void fsc() shared const {}
18 void fsw() shared inout {}
19
20 /*
21 TEST_OUTPUT:
22 ---
23 fail_compilation/fail9199.d(33): Error: function `fail9199.C.fc` without `this` cannot be `const`
24 fail_compilation/fail9199.d(34): Error: function `fail9199.C.fi` without `this` cannot be `immutable`
25 fail_compilation/fail9199.d(35): Error: function `fail9199.C.fw` without `this` cannot be `inout`
26 fail_compilation/fail9199.d(36): Error: function `fail9199.C.fs` without `this` cannot be `shared`
27 fail_compilation/fail9199.d(37): Error: function `fail9199.C.fsc` without `this` cannot be `shared const`
28 fail_compilation/fail9199.d(38): Error: function `fail9199.C.fsw` without `this` cannot be `shared inout`
29 ---
30 */
31 class C
32 {
33 static void fc() const {}
34 static void fi() immutable {}
35 static void fw() inout {}
36 static void fs() shared {}
37 static void fsc() shared const {}
38 static void fsw() shared inout {}
39 }