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 | 568586ff227d06d6670da11e503506eab6ed3b23 (patch) | |
| tree | aae9ebd6fe2f629910bb97a6d82701f175b42b6f /clang/lib/Sema/SemaDecl.cpp | |
| parent | b41ca8f2aeb085306fc8c1027fa621ce0a398fdc (diff) | |
| download | bcm5719-llvm-568586ff227d06d6670da11e503506eab6ed3b23.tar.gz bcm5719-llvm-568586ff227d06d6670da11e503506eab6ed3b23.zip | |
Fix PR6618.
If a struct has an invalid field, mark it as invalid. Also avoid producing
errors about incomplete types that are invalid.
llvm-svn: 99150
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index e11e161ffde..f5f2f947586 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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. |

