To fix issue 15579, PR 5361 was merged.
https://github.com/D-Programming-Language/dmd/pull/5361.
But I noticed that it has changed extern (D) class layout, not only for extern (C++).
https://github.com/D-Programming-Language/dmd/pull/5361/files#r51126555
Test case:
extern (D) //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; }
}
}
void main()
{
Derived d; // dmd 2.069 master
pragma(msg, d.x.offsetof); // (void*).sizeof * 2
pragma(msg, d.y.offsetof); // (void*).sizeof * 3 -> 4
}
I'm not sure it was expected, so I open this regression issue. If it's an intentional change, we should update http://dlang.org/spec/abi ABI page, so there's an explanation for D class object layout.