From: Fariborz Jahanian Date: Thu, 6 Dec 2007 01:37:55 +0000 (+0000) Subject: A missing method in a messaging expression issues a warning, clients must not X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c002726237cc13f9c1f97f1d672eebc55f02080c;p=clang A missing method in a messaging expression issues a warning, clients must not crash because of this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44648 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index ed71934621..95b900c677 100644 --- a/Sema/SemaExpr.cpp +++ b/Sema/SemaExpr.cpp @@ -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())