[Sema] Fix incorrect packed aligned structure layout
authorMomchil Velikov <momchil.velikov@arm.com>
Mon, 21 May 2018 14:28:43 +0000 (14:28 +0000)
committerMomchil Velikov <momchil.velikov@arm.com>
Mon, 21 May 2018 14:28:43 +0000 (14:28 +0000)
commitfe76b36ab1286a1248e7a302dcca4245e91714ad
treeac1579496b7f8fe815c4e2374ad63a7c1199d24c
parent86188d8a404093c37b7b63515aaf223d5aa4d113
[Sema] Fix incorrect packed aligned structure layout

Handle attributes before checking the record layout (e.g. underalignment check
during `alignas` processing), as layout may be cached without taking into
account attributes that may affect it.

Differential Revision: https://reviews.llvm.org/D46439

llvm-svn: 332843
clang/lib/Sema/SemaDecl.cpp
clang/test/Layout/itanium-pack-and-align.cpp [new file with mode: 0644]