aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Sema/SemaExpr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index 56b792eaf5..e7102aa0a2 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -2245,6 +2245,10 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
if (ObjcImplementationDecl *ImpDecl =
ObjcImplementations[ClassDecl->getIdentifier()])
Method = ImpDecl->lookupInstanceMethod(Sel);
+ // If we still haven't found a method, look in the global pool.
+ // I am not fond of this behavior, however we conform to what gcc does.
+ if (!Method)
+ Method = InstanceMethodPool[Sel].Method;
}
if (!Method) {
Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(),