[Issue 6580] New: scoped classes are aligned incorrectly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 30 12:20:14 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6580

           Summary: scoped classes are aligned incorrectly
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: kamm-removethis at incasoftware.de


--- Comment #0 from Christian Kamm <kamm-removethis at incasoftware.de> 2011-08-30 12:20:10 PDT ---
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
.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list