Debian Codegraph @

gcc/testsuite/gdc.test/compilable/test21398.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=21398
2
3 module test21398;
4
5 void free(void* ptr);
6
7 class MAlloc(T)
8 {
9 import test21398: free;
10
11 void free(T)(T* value)
12 {
13 free(value);
14 }
15 }
16
17 struct Box(T)
18 {
19 private T* __ptr;
20 alias A = MAlloc!T;
21
22 ~this()
23 {
24 A.free(__ptr);
25 }
26 }
27
28 void main()
29 {
30 auto b = Box!(char)();
31 }