Debian Codegraph @

gcc/testsuite/gdc.test/runnable/test16980.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=16980
2 interface A { void foo(); }
3 interface B { void bar(); }
4 interface AB : A, B {}
5 class C : AB {
6 void foo() { assert(false, "Must never be called!"); }
7 void bar() {}
8 }
9
10 struct T() {
11 AB ab;
12 ~this() {
13 ab.bar(); // uses wrong vtable
14 }
15 }
16
17 T!() tinst; // triggers semantic3 of dtor from Module::semantic(1)
18
19 void main()
20 {
21 auto dst = T!()(new C);
22 }