diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-17 22:07:07 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-17 22:07:07 +0000 |
commit | 23c0104bb8ad04f06804bd399cbc1f5f962b356c (patch) | |
tree | ec5337603b7fdfb7f0ac81fa01163d4e52c5468a /lib/Sema/SemaDeclObjC.cpp | |
parent | 28f0396ebc9029d622fc43eb2fffaca2c89809ac (diff) |
Diagnose use of incomplete type on method argument type of
method definitions instead of crashing in code gen.
Fixes radar 8421082.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114223 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index a6902a3e39..98c676b5cf 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -55,9 +55,15 @@ void Sema::ActOnStartOfObjCMethodDef(Scope *FnBodyScope, Decl *D) { // Introduce all of the other parameters into this scope. for (ObjCMethodDecl::param_iterator PI = MDecl->param_begin(), - E = MDecl->param_end(); PI != E; ++PI) + E = MDecl->param_end(); PI != E; ++PI) { + ParmVarDecl *Param = (*PI); + if (!Param->isInvalidDecl() && + RequireCompleteType(Param->getLocation(), Param->getType(), + diag::err_typecheck_decl_incomplete_type)) + Param->setInvalidDecl(); if ((*PI)->getIdentifier()) PushOnScopeChains(*PI, FnBodyScope); + } } Decl *Sema:: |