diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-19 23:13:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-19 23:13:55 +0000 |
commit | 83aa61f600456228d4087d7cf160708453b9c9b0 (patch) | |
tree | 702864441d92bda59e96ebee15237cd96b7beba2 /lib/Sema/SemaDecl.cpp | |
parent | eeb44ce483f0cdf55b10936c20a20a0485a40398 (diff) |
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
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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) { |