if (!Redecl && isRedeclaration()) {
// This is the last redeclaration, go back to the first method.
return cast<ObjCContainerDecl>(CtxD)->getMethod(getSelector(),
- isInstanceMethod());
+ isInstanceMethod(),
+ /*AllowHidden=*/true);
}
return Redecl ? Redecl : this;
if (isRedeclaration()) {
// It is possible that we have not done deserializing the ObjCMethod yet.
ObjCMethodDecl *MD =
- cast<ObjCContainerDecl>(CtxD)->getMethod(Sel, isInstanceMethod());
+ cast<ObjCContainerDecl>(CtxD)->getMethod(Sel, isInstanceMethod(),
+ /*AllowHidden=*/true);
return MD ? MD : this;
}
const ObjCMethodDecl *Method = this;
if (Method->isRedeclaration()) {
- Method = cast<ObjCContainerDecl>(Method->getDeclContext())->
- getMethod(Method->getSelector(), Method->isInstanceMethod());
+ Method = cast<ObjCContainerDecl>(Method->getDeclContext())
+ ->getMethod(Method->getSelector(), Method->isInstanceMethod(),
+ /*AllowHidden=*/true);
}
if (Method->isOverriding()) {
--- /dev/null
+@import hidden_redecls;
+
+@interface Foo (Top)
+- (void)top_method;
+@end
+
+// p1_method in protocol P1 is hidden since module_redecls.sub hasn't been
+// imported yet. Check it is still indexed.
+
+// RUN: c-index-test -index-file-full %s -isystem %S/Inputs -fmodules -target x86_64-apple-macosx10.7 | FileCheck %s
+// CHECK: [indexDeclaration]: kind: objc-instance-method | name: p1_method | {{.*}} | loc: {{.*}}hidden-redecls-sub.h:2:9 | {{.*}} | isRedecl: 0
+// CHECK: [indexDeclaration]: kind: objc-instance-method | name: p1_method | {{.*}} | loc: {{.*}}hidden-redecls-sub.h:3:9 | {{.*}} | isRedecl: 1