I can't figure out how to set the alignment of a struct using align(n) on the outside of the struct. Only align on the fields (default or annotated) seems to work. I get the same results back to at least DMD 2.065... Is this a bug or am I using it wrong?

align(32) struct A { ubyte padding; }
pragma(msg, A.alignof); => 1

align(32) struct B { align(32) ubyte padding; }
pragma(msg, B.alignof); => 32

struct C { align(32) ubyte padding; }
pragma(msg, C.alignof); => 32

align(32) struct D { int padding; }
pragma(msg, D.alignof); => 4

Reply via email to