diff options
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 3 |
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()); |