We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When align is the last attribute/storage class of a local variable whose type is inferred, it is silently ignored.
align
The alignment attribute is correctly applied when a type is stated or a storage class is between the alignment attribute and the variable name.
void f() { static align(8) x = 10; static align(8) int y = 10; static assert(is(typeof(x) == typeof(y))); // passes static assert(x.alignof == y.alignof); // fails: `4LU == 8LU` is false } void g() { align(8) static x = 10; align(8) static int y = 10; static assert(is(typeof(x) == typeof(y))); // passes static assert(x.alignof == y.alignof); // passes }
It also only affects local variables; member and global-scope variables are handled differently:
struct S { static align(8) x = 10; // parse error: basic type expected } struct T { align(8) static x = 10; align(8) static int y = 10; static assert(is(typeof(x) == typeof(y))); // passes static assert(x.alignof == y.alignof); // passes }
static align(8) x = 10; // parse error: basic type expected
align(8) static x = 10; align(8) static int y = 10; static assert(is(typeof(x) == typeof(y))); // passes static assert(x.alignof == y.alignof); // passes
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When
align
is the last attribute/storage class of a local variable whose type is inferred, it is silently ignored.The alignment attribute is correctly applied when a type is stated or a storage class is between the alignment attribute and the variable name.
It also only affects local variables; member and global-scope variables are handled differently:
The text was updated successfully, but these errors were encountered: