A missing method in a messaging expression issues a warning, clients must not

crash because of this.

llvm-svn: 44648
This commit is contained in:
Fariborz Jahanian 2007-12-06 01:37:55 +00:00
parent 7f3587e344
commit c277f6f351
1 changed files with 4 additions and 0 deletions

View File

@ -2242,6 +2242,10 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(),
SourceRange(lbrac, rbrac));
returnType = Context.getObjcIdType();
// Must have a dummy method declaration, so clients work as expected
Method = new ObjcMethodDecl(SourceLocation(), SourceLocation(), Sel,
returnType, ClassDecl, 0, -1, 0, true, false,
ObjcMethodDecl::None);
} else {
returnType = Method->getResultType();
if (Sel.getNumArgs())