summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-11-07 23:51:15 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-11-07 23:51:15 +0000
commit05e77f83496710ab950c3f833dbfc847a80d071c (patch)
tree3edd3cce7ab41b7ede5e30772151a5b6bb8997c9 /clang/lib/Sema
parent02862bc83acd8d10a0a8b6cea4b63a25f46ad68a (diff)
downloadbcm5719-llvm-05e77f83496710ab950c3f833dbfc847a80d071c.tar.gz
bcm5719-llvm-05e77f83496710ab950c3f833dbfc847a80d071c.zip
[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
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index ae9942b1c3e..0730cf6e7bf 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -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.
OpenPOWER on IntegriCloud