[Objective-C Sema]. Issue availability/deprecated warning when

there is a uinque method found when message is sent to receiver 
of 'id' type. // rdar://18848183

llvm-svn: 221562
This commit is contained in:
Fariborz Jahanian
2014-11-07 23:51:15 +00:00
parent 02862bc83a
commit 05e77f8349
3 changed files with 25 additions and 6 deletions

View File

@@ -2448,10 +2448,14 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
Method = LookupFactoryMethodInGlobalPool(Sel,
SourceRange(LBracLoc,RBracLoc),
receiverIsId);
if (Method)
if (Method) {
if (ObjCMethodDecl *BestMethod =
SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
Method = BestMethod;
SmallVector<ObjCMethodDecl*, 4> Methods;
if (!CollectMultipleMethodsInGlobalPool(Sel, Methods, Method->isInstanceMethod()))
DiagnoseUseOfDecl(Method, SelLoc);
}
} else if (ReceiverType->isObjCClassType() ||
ReceiverType->isObjCQualifiedClassType()) {
// Handle messages to Class.