`align(N) class C {}` has no effect at all. I'd expect the following behavior:
```
align(64) class AlignedClass { int field; }
static assert(AlignedClass.field.offsetof == 2 * size_t.sizeof); // vtbl, monitor
static assert(__traits(classInstanceAlignment, AlignedClass) == 64);
static assert(__traits(classInstanceSize, AlignedClass) == 2 * size_t.sizeof + 4);
```
See https://github.com/dlang/dmd/pull/14063#issuecomment-1115059532 for an implementation idea.
Comment #1 by dlang-bot — 2022-05-02T19:44:32Z
@kinke updated dlang/dmd pull request #14063 "Add __traits(classInstanceAlignment)" mentioning this issue:
- [remove `align(N) class C {}` tests - no ClassDeclaration.alignment field]
Filed as issue 23081.
https://github.com/dlang/dmd/pull/14063
Comment #2 by dlang-bot — 2022-05-13T08:55:09Z
dlang/dmd pull request #14063 "Add __traits(classInstanceAlignment)" was merged into master:
- cf3add4c2ca142d4ce6cfe2dac6a84b41f398c5c by Martin Kinkelin:
[remove `align(N) class C {}` tests - no ClassDeclaration.alignment field]
Filed as issue 23081.
https://github.com/dlang/dmd/pull/14063
Comment #3 by robert.schadek — 2024-12-13T19:22:34Z