Both 2^^30 and 2^^31 are integers positive power of 2, but forbidden. ---- // OK. align(2 ^^ 30) struct S1 {}; pragma(msg, S1.sizeof); // 1073741824LU // Error: alignment must be an integer positive power of 2, not -2147483648. align(2 ^^ 31) struct S2 {}; // Error: alignment must be an integer positive power of 2, not 0. align(2 ^^ 32) struct S3 {}; --- 2^^32 + 1 is not an integer positive power of 2, but allowed. --- align(2 ^^ 32 + 1) struct S4 {}; pragma(msg, S4.sizeof); // 1LU ----
ShlExp also. ---- align(1 << 31) struct S {}; // Error: alignment must be an integer positive power of 2, not -2147483648 ----
Ahh, I got it. this is not a bug.