Debian Codegraph @

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

raw
1 // REQUIRED_ARGS: -unittest
2
3 /*
4 TEST_OUTPUT:
5 ---
6 fail_compilation/fail7848.d(27): Error: `pure` function `fail7848.C.__unittest_L25_C30` cannot call impure function `fail7848.func`
7 fail_compilation/fail7848.d(27): Error: `@safe` function `fail7848.C.__unittest_L25_C30` cannot call `@system` function `fail7848.func`
8 fail_compilation/fail7848.d(21): `fail7848.func` is declared here
9 fail_compilation/fail7848.d(27): Error: `@nogc` function `fail7848.C.__unittest_L25_C30` cannot call non-@nogc function `fail7848.func`
10 fail_compilation/fail7848.d(27): Error: function `fail7848.func` is not `nothrow`
11 fail_compilation/fail7848.d(25): Error: function `fail7848.C.__unittest_L25_C30` may throw but is marked as `nothrow`
12 fail_compilation/fail7848.d(32): Error: `pure` function `fail7848.C.invariant` cannot call impure function `fail7848.func`
13 fail_compilation/fail7848.d(32): Error: `@safe` function `fail7848.C.invariant` cannot call `@system` function `fail7848.func`
14 fail_compilation/fail7848.d(21): `fail7848.func` is declared here
15 fail_compilation/fail7848.d(32): Error: `@nogc` function `fail7848.C.invariant` cannot call non-@nogc function `fail7848.func`
16 fail_compilation/fail7848.d(32): Error: function `fail7848.func` is not `nothrow`
17 fail_compilation/fail7848.d(30): Error: function `fail7848.C.invariant` may throw but is marked as `nothrow`
18 ---
19 */
20
21 void func() {}
22
23 class C
24 {
25 @safe pure nothrow @nogc unittest
26 {
27 func();
28 }
29
30 @safe pure nothrow @nogc invariant
31 {
32 func();
33 }
34 }