]> gcc.gnu.org Git - gcc.git/commit
d: Respect explicit align(N) type alignment (PR100935)
authorIain Buclaw <ibuclaw@gdcproject.org>
Wed, 9 Jun 2021 17:37:22 +0000 (19:37 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 9 Jun 2021 17:46:53 +0000 (19:46 +0200)
commitc6c3ed60276b842114aefce54d73e30e578fdd6d
treed789c568a1b3207fbd6dc585791f92fe89f00dfa
parent0a9d8fd580d6afab669bae68e116e2135c2a8670
d: Respect explicit align(N) type alignment (PR100935)

It was previously the natural type alignment, defined as the maximum of
the field alignments for an aggregate.  Make sure an explicit align(N)
overrides it.

gcc/d/ChangeLog:

PR d/100935
* dmd/mtype.c (Type::getProperty): Prefer explicit alignment over
natural alignment for alignof property.

gcc/testsuite/ChangeLog:

PR d/100935
* gdc.test/compilable/aggr_alignment.d: Add test cases.

(cherry picked from commit 04fea2d66bd680beb1a204e62f2f459307000813)
gcc/d/dmd/mtype.c
gcc/testsuite/gdc.test/compilable/aggr_alignment.d
This page took 0.059387 seconds and 5 git commands to generate.