From 83aa61f600456228d4087d7cf160708453b9c9b0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 19 Feb 2009 23:13:55 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaDecl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.40.0