www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17857] New: T.alignof ignores explicit align(N) type alignment

https://issues.dlang.org/show_bug.cgi?id=17857

          Issue ID: 17857
           Summary: T.alignof ignores explicit align(N) type alignment
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: kinke gmx.net

T.alignof currently always returns the natural alignment of a type:

align(8) struct Aligned { int a; }
static assert(Aligned.alignof == 8); // fails, 4
align(1) struct Packed { int a; }
static assert(Packed.alignof == 1);  // fails, 4

Fix: https://github.com/dlang/dmd/pull/7164

--
Sep 25 2017