]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail7848.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail7848.d
1 // REQUIRED_ARGS: -unittest
2
3 /*
4 TEST_OUTPUT:
5 ---
6 fail_compilation/fail7848.d(35): Error: pure function 'fail7848.C.__unittestL33_$n$' cannot call impure function 'fail7848.func'
7 fail_compilation/fail7848.d(35): Error: @safe function 'fail7848.C.__unittestL33_$n$' cannot call @system function 'fail7848.func'
8 fail_compilation/fail7848.d(35): Error: @nogc function 'fail7848.C.__unittestL33_$n$' cannot call non-@nogc function 'fail7848.func'
9 fail_compilation/fail7848.d(35): Error: function `fail7848.func` is not nothrow
10 fail_compilation/fail7848.d(33): Error: nothrow function `fail7848.C.__unittestL33_$n$` may throw
11 fail_compilation/fail7848.d(40): Error: pure function 'fail7848.C.__invariant2' cannot call impure function 'fail7848.func'
12 fail_compilation/fail7848.d(40): Error: @safe function 'fail7848.C.__invariant2' cannot call @system function 'fail7848.func'
13 fail_compilation/fail7848.d(40): Error: @nogc function 'fail7848.C.__invariant2' cannot call non-@nogc function 'fail7848.func'
14 fail_compilation/fail7848.d(40): Error: function `fail7848.func` is not nothrow
15 fail_compilation/fail7848.d(38): Error: nothrow function `fail7848.C.__invariant2` may throw
16 fail_compilation/fail7848.d(45): Error: pure allocator 'fail7848.C.new' cannot call impure function 'fail7848.func'
17 fail_compilation/fail7848.d(45): Error: @safe allocator 'fail7848.C.new' cannot call @system function 'fail7848.func'
18 fail_compilation/fail7848.d(45): Error: @nogc allocator 'fail7848.C.new' cannot call non-@nogc function 'fail7848.func'
19 fail_compilation/fail7848.d(45): Error: function `fail7848.func` is not nothrow
20 fail_compilation/fail7848.d(43): Error: nothrow allocator `fail7848.C.new` may throw
21 fail_compilation/fail7848.d(51): Error: pure deallocator 'fail7848.C.delete' cannot call impure function 'fail7848.func'
22 fail_compilation/fail7848.d(51): Error: @safe deallocator 'fail7848.C.delete' cannot call @system function 'fail7848.func'
23 fail_compilation/fail7848.d(51): Error: @nogc deallocator 'fail7848.C.delete' cannot call non-@nogc function 'fail7848.func'
24 fail_compilation/fail7848.d(51): Error: function `fail7848.func` is not nothrow
25 fail_compilation/fail7848.d(49): Error: nothrow deallocator `fail7848.C.delete` may throw
26 ---
27 */
28
29 void func() {}
30
31 class C
32 {
33 @safe pure nothrow @nogc unittest
34 {
35 func();
36 }
37
38 @safe pure nothrow @nogc invariant
39 {
40 func();
41 }
42
43 @safe pure nothrow @nogc new (size_t sz)
44 {
45 func();
46 return null;
47 }
48
49 @safe pure nothrow @nogc delete (void* p)
50 {
51 func();
52 }
53 }