summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-19 23:13:55 +0000
committerChris Lattner <sabre@nondot.org>2009-02-19 23:13:55 +0000
commitae0197e1344a0af0be2059564deb5f9e6b1e98c6 (patch)
treea01bf302abee494ee31332663c2bbabcdf059385 /clang
parent2a07da78c0269c1f737d12cdf638e44d0d9992fe (diff)
downloadbcm5719-llvm-ae0197e1344a0af0be2059564deb5f9e6b1e98c6.tar.gz
bcm5719-llvm-ae0197e1344a0af0be2059564deb5f9e6b1e98c6.zip
GetTypeForDeclarator can return null on error now, handle this.
llvm-svn: 65076
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index f3eb201fa22..7b54b8bc7c8 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud