]> granicus.if.org Git - clang/commitdiff
A missing method in a messaging expression issues a warning, clients must not
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 6 Dec 2007 01:37:55 +0000 (01:37 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 6 Dec 2007 01:37:55 +0000 (01:37 +0000)
crash because of this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44648 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaExpr.cpp

index ed719346215e354cec5246341b55184cc1c53d15..95b900c67727a795cefa1e5fb8d8c2411899933b 100644 (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())