diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-13 23:38:04 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-13 23:38:04 +0000 |
| commit | d288fad37473d54e137deebc9444c4af0996c75d (patch) | |
| tree | 8992075abd524e59dd004169f184217ae7cb380d | |
| parent | ebf09360ec66ed380f491774461aa94cfeb51c8e (diff) | |
| download | bcm5719-llvm-d288fad37473d54e137deebc9444c4af0996c75d.tar.gz bcm5719-llvm-d288fad37473d54e137deebc9444c4af0996c75d.zip | |
Objective-C. Handle case of multiple class methods
found in global pool as well. rdar://16808765
llvm-svn: 215603
| -rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 6 | ||||
| -rw-r--r-- | clang/test/SemaObjC/resolve-method-in-global-pool.m | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 80ce9baee75..0facca03915 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -2420,7 +2420,7 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, receiverIsId); if (Method) if (ObjCMethodDecl *BestMethod = - SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod())) + SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod())) Method = BestMethod; } else if (ReceiverType->isObjCClassType() || ReceiverType->isObjCQualifiedClassType()) { @@ -2473,6 +2473,10 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, << Sel << SourceRange(LBracLoc, RBracLoc); } } + if (Method) + if (ObjCMethodDecl *BestMethod = + SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod())) + Method = BestMethod; } } } diff --git a/clang/test/SemaObjC/resolve-method-in-global-pool.m b/clang/test/SemaObjC/resolve-method-in-global-pool.m index 38a2bb7ca5b..2c5dde4cba9 100644 --- a/clang/test/SemaObjC/resolve-method-in-global-pool.m +++ b/clang/test/SemaObjC/resolve-method-in-global-pool.m @@ -4,7 +4,9 @@ // rdar://16808765 -@interface NSObject @end +@interface NSObject ++ (void)clsMethod:(int*)arg; +@end @class NSDictionary; @class NSError; @@ -18,6 +20,7 @@ @required - (void)getDonuts:(void (^)(NSDictionary *))replyBlock; - (void)getCake:(float*)arg, ...; ++ (void)clsMethod:(float*)arg; @end @implementation Foo @@ -33,3 +36,7 @@ [(id)0 getCake: &g, 1,3.14]; } @end + +void func( Class c, float g ) { + [c clsMethod: &g]; +} |

