diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-12 22:12:06 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-12 22:12:06 +0000 |
| commit | 38d7919cac58b69a088e8ac426b82f8e68510514 (patch) | |
| tree | 4a510d90f3ba7a8e5b800565ceb31646ef444d42 | |
| parent | 6688b0a5dadb357f5b6c217693ad8b8350a8750e (diff) | |
| download | bcm5719-llvm-38d7919cac58b69a088e8ac426b82f8e68510514.tar.gz bcm5719-llvm-38d7919cac58b69a088e8ac426b82f8e68510514.zip | |
fix code that incorrectly assumed that GetTypeForDeclarator cannot
return null.
llvm-svn: 68916
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8ce624b7888..6c2440ff68e 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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. |

