aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-05-09 05:34:49 +0000
committerChris Lattner <sabre@nondot.org>2008-05-09 05:34:49 +0000
commitabb575866059c9bb74fe4aa32372f002143fa87c (patch)
tree298ec9aabaa2246588b2c894448c9107c20d9e41 /lib/Sema/SemaDecl.cpp
parent039a64212713aebdcc196ea41135c2af4f4386dc (diff)
Fix rdar://5921025 a crash on the included testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 373727a5d8..9a7d692c97 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2183,7 +2183,8 @@ void Sema::HandlePackedAttribute(Decl *d, AttributeList *rawAttr) {
else if (FieldDecl *FD = dyn_cast<FieldDecl>(d)) {
// If the alignment is less than or equal to 8 bits, the packed attribute
// has no effect.
- if (Context.getTypeAlign(FD->getType()) <= 8)
+ if (!FD->getType()->isIncompleteType() &&
+ Context.getTypeAlign(FD->getType()) <= 8)
Diag(rawAttr->getLoc(),
diag::warn_attribute_ignored_for_field_of_type,
rawAttr->getName()->getName(), FD->getType().getAsString());