[Issue 15579] extern(C++) interfaces/multiple-inheritance
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Thu Jan 21 11:46:09 PST 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15579
Walter Bright <bugzilla at digitalmars.com> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com
--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> ---
Compilable D version of the code:
  extern (C++)
  {
    class Base
    {
        ~this() {}
        size_t x = 4;
    }
    interface Interface
    {
        int Method();
    }
    class Derived : Base, Interface
    {
        size_t y = 5;
        int Method() { return 3; }
    }
  }
The layout for Win64 Base is:
  4Base6__initZ:
    void* &vtbl
    size_t x;
The layout for Win64 Derived is:
  7Derived6__initZ:
    void* &vtbl
    size_t x;
    size_t y;
    void* &vtbl
These can be figured out by running obj2asm on the object file and looking at
it.
--
    
    
More information about the Digitalmars-d-bugs
mailing list