Bug 15618 – [REG-master] Class member layout has been changed, ABI needs to be updated?

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-28T14:24:00Z
Last change time
2016-02-04T01:34:21Z
Assigned to
nobody
Creator
k.hara.pg
See also
https://issues.dlang.org/show_bug.cgi?id=15644

Comments

Comment #0 by k.hara.pg — 2016-01-28T14:24:19Z
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.
Comment #1 by bugzilla — 2016-02-01T04:30:23Z
You're right, the D ABI shouldn't have changed.
Comment #2 by bugzilla — 2016-02-01T04:40:07Z
Comment #3 by github-bugzilla — 2016-02-01T11:28:41Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5bebb65a4dacef5cf33701e6d2dae61a41f460b4 fix Issue 15618 - [REG-master] Class member layout has been changed, ABI needs to be updated? https://github.com/D-Programming-Language/dmd/commit/9c90f94b8537965b16eb7c09289fcd040664e4fe Merge pull request #5387 from WalterBright/fix15618 fix Issue 15618 - [REG-master] Class member layout has been changed, …