[cfe-dev] c++11's alignas() ignored inside #pragma pack
jahanian
fjahanian at apple.com
Tue Jul 22 13:03:44 PDT 2014
Implementation says that it is intentional:
// The maximum field alignment overrides the aligned attribute.
if (!MaxFieldAlignment.isZero()) {
FieldAlign = std::min(FieldAlign, MaxFieldAlignment);
UnpackedFieldAlign = std::min(UnpackedFieldAlign, MaxFieldAlignment);
}
- Fariborz
On Jul 22, 2014, at 11:04 AM, jahanian <fjahanian at apple.com> wrote:
> This test shows that alignas() is ignored when used with #pragma.
> Is this intentional behavior?
>
> #pragma pack(push, 1)
> struct S1 { char a; short b; double c; alignas(32) double d; char e; double f; };
> #pragma pack(pop)
>
> int main()
> {
> return sizeof(struct S1);
> }
>
> - Thanks, Fariborz
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140722/22cbb5b7/attachment.html>
More information about the cfe-dev
mailing list