dmd/changelog/dmd.default-align.dd
2025-02-14 08:23:16 +08:00

23 lines
410 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

The `align` attribute now allows specifying `default` explicitly
A lone `align` sets the alignment to the types default.
To be more explicit, `align(default)` does the same.
```
struct S
{
align(4)
{
byte x;
align(default) long y;
long z;
}
}
void main()
{
pragma(msg, S.x.alignof); // 4
pragma(msg, S.y.alignof); // 8
pragma(msg, S.z.alignof); // 4
}
```