[Issue 13305] Inconsistency in empty class and interface parsing

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 21 19:00:37 PDT 2014


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

--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> ---
I guess that the limitation has came from C++ class declaration syntax.

// C++ code
class C {};
class D : public C;   // NG

But I'm not sure the opaque class declaration with base class/interfaces can
work with current ABI. For example:


class C { void foo() {} }
class I { void bar(); }
class D : C, I;     // opaque with base class/interfaces
D makeD();
void main()
{
    D d = makeD();
    d.foo();  // might work
    d.bar();  // can work...? vtbl of any base interfaces may not be accessible
              // because __traits(classInstanceSize, D) is unknown.
}

--


More information about the Digitalmars-d-bugs mailing list