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 ed71934..95b900c 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -2242,6 +2242,10 @@
       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())