diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-05-05 21:19:14 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-05-05 21:19:14 +0000 |
commit | 78a7d7d79964119a3f35b262eb154b5cbf1001ed (patch) | |
tree | cf58a33aa902c2de40aef863002fe033b7a2c1cd /lib/AST/ASTContext.cpp | |
parent | 6df78739f3b3f672f9735445741cbcfa7c10fb1f (diff) |
__alignof attribute on the field must consider
packed attribute on the field. //rdar://9217290
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 717c3a8ffe..d6535e9f8c 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -635,6 +635,10 @@ CharUnits ASTContext::getDeclAlign(const Decl *D, bool RefAsPointee) const { UseAlignAttrOnly = true; } } + else if (isa<FieldDecl>(D)) + UseAlignAttrOnly = + D->hasAttr<PackedAttr>() || + cast<FieldDecl>(D)->getParent()->hasAttr<PackedAttr>(); // If we're using the align attribute only, just ignore everything // else about the declaration and its type. |