<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 14, 2013, at 4:47 PM, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><br></div></blockquote><div><br></div><div>Bikeshedding on the diagnostic a little bit: "receiver is instance of class declared here" or even "receiver interface declared here". "object of the class" sounds very strange to me.</div><div><br></div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">def note_receiver_is_id : Note<<br>  "receiver is treated with 'id' type for purpose of method lookup">;<br>def note_suppressed_class_declare : Note<<br><br>Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=181847&r1=181846&r2=181847&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=181847&r1=181846&r2=181847&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)<br>+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Tue May 14 18:24:17 2013<br>@@ -1221,10 +1221,19 @@ bool Sema::CheckMessageArgumentTypes(Qua<br>    else<br>      DiagID = isClassMessage ? diag::warn_class_method_not_found<br>                              : diag::warn_inst_method_not_found;<br>-    if (!getLangOpts().DebuggerSupport)<br>+    if (!getLangOpts().DebuggerSupport) {<br>      Diag(SelLoc, DiagID)<br>        << Sel << isClassMessage << SourceRange(SelectorLocs.front(),<span class="Apple-converted-space"> </span><br>                                                SelectorLocs.back());<br>+      // Find the class to which we are sending this message.<br>+      if (ReceiverType->isObjCObjectPointerType()) {<br>+        QualType ClassType =<br>+          ReceiverType->getAs<ObjCObjectPointerType>()->getPointeeType();<br>+        if (const ObjCObjectType *ClassTPtr = ClassType->getAs<ObjCObjectType>())<br>+          if (ObjCInterfaceDecl *Class = ClassTPtr->getInterface())<br>+            Diag(Class->getLocation(), diag::note_receiver_class_declared);<br>+      }<br>+    }<br></div></blockquote><div><br></div><div>You don't really need to double the ifs here. Just use ReceiverType->getAs<ObjCObjectPointerType>() and then ObjCObjectPointerType::getInterfaceDecl().</div></div></blockquote><div><br></div>In r181896.</div><div>- Fariborz<br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">    // In debuggers, we want to use __unknown_anytype for these<br>    // results so that clients can cast them.</div></blockquote></div></blockquote></div><br></body></html>