From: Chris Lattner Date: Thu, 19 Feb 2009 23:13:55 +0000 (+0000) Subject: GetTypeForDeclarator can return null on error now, handle this. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83aa61f600456228d4087d7cf160708453b9c9b0;p=clang 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 f3eb201fa2..7b54b8bc7c 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1376,7 +1376,10 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl, 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) {