diff options
author | Manman Ren <manman.ren@gmail.com> | 2016-04-07 19:32:24 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2016-04-07 19:32:24 +0000 |
commit | b96505ea68abd42ea279430de63301c6c76d4803 (patch) | |
tree | 59c5ac9b76c49934e3e0e94bbe9d361b7ba6ddc8 /lib/Sema/SemaExprObjC.cpp | |
parent | b85565fd6cd6ccb6079ee4171715523a6653867d (diff) | |
download | clang-b96505ea68abd42ea279430de63301c6c76d4803.tar.gz |
[ObjC kindof] Use type bound to filter out the candidate methods.
rdar://21306753
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 7a51e612af..56161c7a4d 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -2618,16 +2618,15 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, if (!Method) { // Handle messages to id and __kindof types (where we use the // global method pool). - // FIXME: The type bound is currently ignored by lookup in the - // global pool. const ObjCObjectType *typeBound = nullptr; bool receiverIsIdLike = ReceiverType->isObjCIdOrObjectKindOfType(Context, typeBound); if (receiverIsIdLike || ReceiverType->isBlockPointerType() || (Receiver && Context.isObjCNSObjectType(Receiver->getType()))) { SmallVector<ObjCMethodDecl*, 4> Methods; + // If we have a type bound, further filter the methods. CollectMultipleMethodsInGlobalPool(Sel, Methods, true/*InstanceFirst*/, - true/*CheckTheOther*/); + true/*CheckTheOther*/, typeBound); if (!Methods.empty()) { // We chose the first method as the initial condidate, then try to // select a better one. |