diff options
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 3a07ef6783..d92b9fe71c 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -4478,10 +4478,21 @@ static ObjCMethodDecl *AddSuperSendCompletion(Sema &S, bool NeedSuperKeyword, // Try to find a superclass method with the same selector. ObjCMethodDecl *SuperMethod = 0; - while ((Class = Class->getSuperClass()) && !SuperMethod) + while ((Class = Class->getSuperClass()) && !SuperMethod) { + // Check in the class SuperMethod = Class->getMethod(CurMethod->getSelector(), CurMethod->isInstanceMethod()); + // Check in categories or class extensions. + if (!SuperMethod) { + for (ObjCCategoryDecl *Category = Class->getCategoryList(); Category; + Category = Category->getNextClassCategory()) + if ((SuperMethod = Category->getMethod(CurMethod->getSelector(), + CurMethod->isInstanceMethod()))) + break; + } + } + if (!SuperMethod) return 0; |