when in the context of an @implementation, look for private methods in the
@implementation to resolve nullary selector references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53845 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 99a7afd..56a1f81 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -251,10 +251,9 @@
// Handle messages to Class.
if (receiverType == Context.getObjCClassType().getCanonicalType()) {
ObjCMethodDecl *Method = 0;
- if (getCurMethodDecl()) {
- ObjCInterfaceDecl* ClassDecl = getCurMethodDecl()->getClassInterface();
+ if (ObjCMethodDecl *CurMeth = getCurMethodDecl()) {
// If we have an implementation in scope, check "private" methods.
- if (ClassDecl)
+ if (ObjCInterfaceDecl *ClassDecl = CurMeth->getClassInterface())
if (ObjCImplementationDecl *ImpDecl =
ObjCImplementations[ClassDecl->getIdentifier()])
Method = ImpDecl->getClassMethod(Sel);