www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15589] New: extern(C++) virtual destructors are not put in

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 puremagic.com
          Reporter: bugzilla 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() { }

--
Jan 21