summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-03-21 22:56:43 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-03-21 22:56:43 +0000
commit568586ff227d06d6670da11e503506eab6ed3b23 (patch)
treeaae9ebd6fe2f629910bb97a6d82701f175b42b6f /clang/lib/Sema/SemaDecl.cpp
parentb41ca8f2aeb085306fc8c1027fa621ce0a398fdc (diff)
downloadbcm5719-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.cpp4
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.
OpenPOWER on IntegriCloud