summaryrefslogtreecommitdiffstats
path: root/clang/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
commit2677e1073204747b10d231c441384750e1c08e09 (patch)
treefa01a38d1abc88ea7f1dfab1b41cb1cfc2c3a6fe /clang/lib/Sema/SemaDecl.cpp
parentfa7d44687f95afe90ca60f11b974369a5ce522f6 (diff)
downloadbcm5719-llvm-2677e1073204747b10d231c441384750e1c08e09.tar.gz
bcm5719-llvm-2677e1073204747b10d231c441384750e1c08e09.zip
A field of incomplete type is sufficiently disruptive that we should mark
the record invalid. llvm-svn: 111211
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index cc6e2fa3501..b7b802a72f1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud