aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-12 22:12:06 +0000
committerChris Lattner <sabre@nondot.org>2009-04-12 22:12:06 +0000
commit798d5696ef5b4e3f47a6bed3c4f68f34c4810745 (patch)
tree597d2e86cd47fe5b423dc8eea02c92fda0f55f92 /lib/Sema/SemaDecl.cpp
parent4c97d762d8c5a84f6554e5bfb31d28c90df64158 (diff)
fix code that incorrectly assumed that GetTypeForDeclarator cannot
return null. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68916 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 8ce624b788..6c2440ff68 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2678,9 +2678,11 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
// type was invalid, GetTypeForDeclarator() still returns a "valid" type,
// though it will not reflect the user specified type.
QualType parmDeclType = GetTypeForDeclarator(D, S);
+ if (parmDeclType.isNull()) {
+ D.setInvalidType(true);
+ parmDeclType = Context.IntTy;
+ }
- assert(!parmDeclType.isNull() && "GetTypeForDeclarator() returned null type");
-
// TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
// Can this happen for params? We already checked that they don't conflict
// among each other. Here they can only shadow globals, which is ok.