[Issue 16508] Alignment of class members is not respected. Affects new, scoped and classInstanceAlignment.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 9 10:01:11 UTC 2021


--- Comment #8 from Max Samukha <maxsamukha at gmail.com> ---
(In reply to kinke from comment #7)
> (In reply to Max Samukha from comment #6)
> > (I assume you meant align(classInstanceAlignment!C), which currently
> > produces wrong results due to this bug)
> Yeah sorry, of course. We'll probably need a
> __traits(classInstanceAlignment) I guess, as `align(64) class C { int x; }`
> won't be inferrable by looking at the field alignments.

Yeah, I forgot about the external align. It seems the trait is necessary.

> > I'm sorry to disagree.
> No problem there. But it's the size the compiler uses (for the init symbol,
> the TypeInfo.initializer() etc.), not some library bug, and it's working.

Bugs will most likely be revealed in those when/if the align attribute is fixed
and people start using it.


More information about the Digitalmars-d-bugs mailing list