diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 0e5de3ab1470..bed9d5d306ae 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/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; }