Bug 6580 – scoped classes are aligned incorrectly

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-08-30T12:20:00Z
Last change time
2012-05-09T00:06:34Z
Assigned to
nobody
Creator
kamm-removethis

Comments

Comment #0 by kamm-removethis — 2011-08-30T12:20:10Z
Test case: import std.typecons; class C { int i; byte b; } void main() { auto sa = [scoped!C, scoped!C]; assert(cast(size_t)&sa[0].i % int.alignof == 0); assert(cast(size_t)&sa[1].i % int.alignof == 0); // fails } The problem is that the payload is declared as private ubyte[__traits(classInstanceSize, T)] Scoped_store = void; in std.typecons.scoped, as discussed at https://github.com/D-Programming-Language/phobos/pull/148#issuecomment-1590157 .
Comment #1 by verylonglogin.reg — 2012-05-04T12:39:57Z
Comment #2 by github-bugzilla — 2012-05-08T23:43:01Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/2503b18d1c6bba9e697e6eb0bf1914a65acdf215 Fix Issue 6580 - scoped classes are aligned incorrectly https://github.com/D-Programming-Language/phobos/commit/84218d3e1ebe5efb04b64e121a27870184334f84 Merge pull request #570 from denis-sh/scoped-bug6580-fix Fix Issue 6580 - scoped classes are aligned incorrectly