From 0b2f7ea2794bc9e8d2f8328d78d61f8ec55dd023 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 21 Jul 2008 06:16:07 +0000 Subject: [PATCH] improve diagnostics about problems with receivers to highlight the receiver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53842 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExprObjC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 0e5de3ab14..bed9d5d306 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -266,7 +266,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage( Method = InstanceMethodPool[Sel].Method; if (!Method) { Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(), - SourceRange(lbrac, rbrac)); + RExpr->getSourceRange()); returnType = Context.getObjCIdType(); } else { returnType = Method->getResultType(); @@ -295,7 +295,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage( if (!Method) Diag(lbrac, diag::warn_method_not_found_in_protocol, std::string("-"), Sel.getName(), - SourceRange(lbrac, rbrac)); + RExpr->getSourceRange()); } else if (const ObjCInterfaceType *OCIReceiver = receiverType->getAsPointerToObjCInterfaceType()) { // We allow sending a message to a pointer to an interface (an object). @@ -321,7 +321,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage( SourceRange(lbrac, rbrac)); } else { Diag(lbrac, diag::error_bad_receiver_type, - RExpr->getType().getAsString()); + RExpr->getType().getAsString(), RExpr->getSourceRange()); return true; } -- 2.50.1