Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5387 from WalterBright/fix15618
fix Issue 15618 - [REG-master] Class member layout has been changed, …
- Loading branch information
Showing
3 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class Base | ||
{ | ||
~this() {} | ||
size_t x = 4; | ||
} | ||
|
||
interface Interface | ||
{ | ||
int Method(); | ||
} | ||
|
||
class Derived : Base, Interface | ||
{ | ||
size_t y = 5; | ||
int Method() { return 3; } | ||
} | ||
|
||
static assert(Derived.x.offsetof == (void*).sizeof * 2); | ||
static assert(Derived.y.offsetof == (void*).sizeof * 3); |