aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-16 23:42:35 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-16 23:42:35 +0000
commit2d7d2d99bc450ac1472086a6d57e77a1995297f8 (patch)
tree1014cb752d05d98ed3fb342cdc91fe3e9da4ca4f /lib/Sema/SemaDecl.cpp
parentb2dc7f59fe4c762cba73badc3bbc6f356fcd7b5b (diff)
A field of incomplete type is sufficiently disruptive that we should mark
the record invalid. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index cc6e2fa350..b7b802a72f 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -5955,8 +5955,11 @@ FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T,
QualType EltTy = Context.getBaseElementType(T);
if (!EltTy->isDependentType() &&
- RequireCompleteType(Loc, EltTy, diag::err_field_incomplete))
+ RequireCompleteType(Loc, EltTy, diag::err_field_incomplete)) {
+ // Fields of incomplete type force their record to be invalid.
+ Record->setInvalidDecl();
InvalidDecl = true;
+ }
// C99 6.7.2.1p8: A member of a structure or union may have any type other
// than a variably modified type.