[Issue 12636] extern(C++) class that implements D interface segfaults

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 25 03:09:06 PDT 2014


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

yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies at gmail.com

--- Comment #2 from yebblies <yebblies at gmail.com> ---
I'm not sure this _can_ work.  Converting from a class reference to an
interface reference requires adjusting the this pointer so it picks up the
correct vtable (IIRC) and you can't do this without classinfo (again IIRC).

There is no such thing as COM classes, on COM interfaces, and COM classes would
have the same problem.  A D class implementing an extern(C++) interface should
work.

If so, this should probably be rejected at compile time.

--


More information about the Digitalmars-d-bugs mailing list