Fix <rdar://problem/6614945> method not found.
This was a fairly recent regression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65547 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index e3d2074..5be8460 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -395,10 +395,10 @@
}
if (Method && DiagnoseUseOfDecl(Method, receiverLoc))
return true;
- } else {
- // We're not in a method context, look for any factory method named 'Sel'.
- Method = FactoryMethodPool[Sel].Method;
}
+ // Look for any factory method named 'Sel'.
+ if (!Method)
+ Method = FactoryMethodPool[Sel].Method;
if (!Method)
Method = LookupInstanceMethodInGlobalPool(
Sel, SourceRange(lbrac,rbrac));