We want to diagnose sending message to a forward class
and we also want to tell which message is actually 
being sent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71296 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 3dbc2cf..de6b69f 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -424,10 +424,11 @@
   QualType returnType;
   if (ClassDecl->isForwardDecl()) {
     // A forward class used in messaging is tread as a 'Class'
+    Diag(lbrac, diag::warn_receiver_forward_class) << ClassDecl->getDeclName();
     Method = LookupFactoryMethodInGlobalPool(Sel, SourceRange(lbrac,rbrac));
     if (Method)
-      Diag(lbrac, diag::warn_receiver_forward_class) 
-        << ClassDecl->getDeclName();
+      Diag(Method->getLocation(), diag::note_method_sent_forward_class) 
+        << Method->getDeclName();
   }
   if (!Method)
     Method = ClassDecl->lookupClassMethod(Context, Sel);