[Issue 15589] New: extern(C++) virtual destructors are not put in vtbl[]

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jan 21 23:55:21 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15589

          Issue ID: 15589
           Summary: extern(C++) virtual destructors are not put in vtbl[]
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

A problem with the virtual destructor, as DMD doesn't allocate a vtbl[] slot.
To workaround on the D end, replace:

    ~this() { }

with:

    dtor() { }

It's even worse on Linux, where the destructor takes two vtbl[] slots, and so
the workaround is:

    dtor1() { }
    dtor1() { }

--


More information about the Digitalmars-d-bugs mailing list