May 02, 2022 [Issue 23081] New: align(N) attribute ignored for ClassDeclarations | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23081 Issue ID: 23081 Summary: align(N) attribute ignored for ClassDeclarations Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: kinke@gmx.net `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. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply