aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 598ad0b27a..a3fe7d3bbe 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -1379,10 +1379,12 @@ static void DiagnoseARCUseOfWeakReceiver(Sema &S, Expr *Receiver) {
ObjCMethodDecl *Method = ME->getMethodDecl();
if (Method && Method->isSynthesized()) {
Selector Sel = Method->getSelector();
- if (Sel.getNumArgs() == 0)
+ if (Sel.getNumArgs() == 0) {
+ const DeclContext *Container = Method->getDeclContext();
PDecl =
- S.LookupPropertyDecl(Method->getClassInterface(),
+ S.LookupPropertyDecl(cast<ObjCContainerDecl>(Container),
Sel.getIdentifierInfoForSlot(0));
+ }
if (PDecl)
T = PDecl->getType();
}