fix the sizeof error recovery issue (sizeof-interface.m:attributeRuns)
by correctly propagating the fact that the type was invalid up to the
attributeRuns decl, then returning an ExprError when attributeRuns is
formed (like we do for normal declrefexprs).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69998 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 63b0062..e2f0ea4 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3820,7 +3820,7 @@
// example, unnamed unions inject all members into the struct namespace!
QualType T = GetTypeForDeclarator(D, S);
- bool InvalidDecl = false;
+ bool InvalidDecl = D.getInvalidType();
if (T.isNull()) {
InvalidDecl = true;
T = Context.IntTy;