diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-03-21 22:56:43 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-03-21 22:56:43 +0000 |
commit | 01620704304f819b82ecef769ec114e541a364d7 (patch) | |
tree | 156056bbd0e9dcf77a4971756a44875c2e88e096 /lib/Sema/SemaDecl.cpp | |
parent | 2d52be56ff595341be3c6cec337af6763804ce66 (diff) |
Fix PR6618.
If a struct has an invalid field, mark it as invalid. Also avoid producing
errors about incomplete types that are invalid.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index e11e161ffd..f5f2f94758 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -5261,6 +5261,10 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record, FieldDecl *NewFD = CheckFieldDecl(II, T, TInfo, Record, Loc, Mutable, BitWidth, TSSL, AS, PrevDecl, &D); + + if (NewFD->isInvalidDecl()) + Record->setInvalidDecl(); + if (NewFD->isInvalidDecl() && PrevDecl) { // Don't introduce NewFD into scope; there's already something // with the same name in the same scope. |