https://issues.dlang.org/show_bug.cgi?id=21690
--- Comment #3 from [email protected] --- (In reply to kinke from comment #1) > The C++ vtable emitted by D does not contain any pointer to any typeinfo > AFAIK. Of course we don't generate the C++ typeinfo anyway, but we do > generate the D one (for use with the D GC). At least some C++ > implementations store the (C++) typeinfo pointer at vtbl index -1. But then > again, when we are confronted with some C++ class ref, we have no idea > whether it was instantiated on the D side or C++ side and so which vtable > its vptr points to. Does that mean that passing a D-initialized extern(C++) class instance to C++ code breaks dynamic casting on the C++ side, too? If so, that is a critical issue, as well. Given that all current D compilers are also C++ compilers, would it be possible to just auto-generate an actual C++ function that performs the dynamic_cast<>, and then call (and hopefully inline) that function from the D side? --
