GetTypeForDeclarator can return null on error now, handle this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65076 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index f3eb201..7b54b8b 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1376,7 +1376,10 @@
PrevDecl = 0;
QualType R = GetTypeForDeclarator(D, S);
- assert(!R.isNull() && "GetTypeForDeclarator() returned null type");
+ if (R.isNull()) {
+ InvalidDecl = true;
+ R = Context.IntTy;
+ }
bool Redeclaration = false;
if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef) {