[PATCH] D79719: [AIX] Implement AIX special alignment rule about double/long double
Hubert Tong via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 3 16:11:07 PDT 2020
hubert.reinterpretcast added inline comments.
================
Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1877
+ CharUnits PreferredAlign = FieldAlign;
+ if (SupportsAIXPowerAlignment && FieldOffset == CharUnits::Zero() &&
+ (IsUnion || FoundNonOverlappingEmptyField)) {
----------------
This `if` condition does not currently capture that a zero-extent array in a base class renders the base class not empty.
```
struct Z { char zea[0]; };
struct A {
Z z [[no_unique_address]];
double d;
};
struct B : Z { double d; };
static_assert(__alignof__(A) == __alignof__(B));
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79719/new/
https://reviews.llvm.org/D79719
More information about the cfe-commits
mailing list