]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/compilable/riia_ctor.d
1c8e142b7964cc6cd2769e53e431714b1c8c74a6
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / riia_ctor.d
1 // https://issues.dlang.org/show_bug.cgi?id=17494
2 struct S
3 {
4 ~this() {}
5 }
6
7 class C
8 {
9 S s;
10
11 this() nothrow {}
12 }
13
14 // https://issues.dlang.org/show_bug.cgi?id=17505
15 struct Array
16 {
17 int[] _payload;
18 ~this()
19 {
20 import core.stdc.stdlib : free;
21 free(_payload.ptr);
22 }
23 }
24
25 class Scanner
26 {
27 Array arr;
28 this() @safe {}
29 }
30
31 // https://issues.dlang.org/show_bug.cgi?id=17506
32 struct TreeMap
33 {
34 this() @disable;
35 this(TTree tree) { this.tree = tree; }
36 TTree tree;
37 }
38
39 struct TTree
40 {
41 this() @disable;
42 this(int foo) {}
43 ~this() {}
44 }