File tree Expand file tree Collapse file tree 5 files changed +37
-4
lines changed Expand file tree Collapse file tree 5 files changed +37
-4
lines changed Original file line number Diff line number Diff line change @@ -949,7 +949,8 @@ ObjCMethodDecl *ObjCMethodDecl::getNextRedeclarationImpl() {
949
949
if (!Redecl && isRedeclaration ()) {
950
950
// This is the last redeclaration, go back to the first method.
951
951
return cast<ObjCContainerDecl>(CtxD)->getMethod (getSelector (),
952
- isInstanceMethod ());
952
+ isInstanceMethod (),
953
+ /* AllowHidden=*/ true );
953
954
}
954
955
955
956
return Redecl ? Redecl : this ;
@@ -982,7 +983,8 @@ ObjCMethodDecl *ObjCMethodDecl::getCanonicalDecl() {
982
983
if (isRedeclaration ()) {
983
984
// It is possible that we have not done deserializing the ObjCMethod yet.
984
985
ObjCMethodDecl *MD =
985
- cast<ObjCContainerDecl>(CtxD)->getMethod (Sel, isInstanceMethod ());
986
+ cast<ObjCContainerDecl>(CtxD)->getMethod (Sel, isInstanceMethod (),
987
+ /* AllowHidden=*/ true );
986
988
return MD ? MD : this ;
987
989
}
988
990
@@ -1299,8 +1301,9 @@ void ObjCMethodDecl::getOverriddenMethods(
1299
1301
const ObjCMethodDecl *Method = this ;
1300
1302
1301
1303
if (Method->isRedeclaration ()) {
1302
- Method = cast<ObjCContainerDecl>(Method->getDeclContext ())->
1303
- getMethod (Method->getSelector (), Method->isInstanceMethod ());
1304
+ Method = cast<ObjCContainerDecl>(Method->getDeclContext ())
1305
+ ->getMethod (Method->getSelector (), Method->isInstanceMethod (),
1306
+ /* AllowHidden=*/ true );
1304
1307
}
1305
1308
1306
1309
if (Method->isOverriding ()) {
Original file line number Diff line number Diff line change
1
+ @protocol P1
2
+ - (void )p1_method ;
3
+ - (void )p1_method ;
4
+ @end
5
+
6
+ @interface Foo (SubP1) <P1>
7
+ @end
Original file line number Diff line number Diff line change
1
+ @interface Foo
2
+ - (void )parent_method ;
3
+ @end
Original file line number Diff line number Diff line change @@ -20,3 +20,11 @@ module PreambleWithImplicitImport {
20
20
export *
21
21
}
22
22
}
23
+
24
+ module hidden_redecls {
25
+ header "hidden-redecls.h"
26
+
27
+ explicit module sub {
28
+ header "hidden-redecls-sub.h"
29
+ }
30
+ }
Original file line number Diff line number Diff line change
1
+ @import hidden_redecls;
2
+
3
+ @interface Foo (Top)
4
+ - (void )top_method ;
5
+ @end
6
+
7
+ // p1_method in protocol P1 is hidden since module_redecls.sub hasn't been
8
+ // imported yet. Check it is still indexed.
9
+
10
+ // RUN: c-index-test -index-file-full %s -isystem %S/Inputs -fmodules -target x86_64-apple-macosx10.7 | FileCheck %s
11
+ // CHECK: [indexDeclaration]: kind: objc-instance-method | name: p1_method | {{.*}} | loc: {{.*}}hidden-redecls-sub.h:2:9 | {{.*}} | isRedecl: 0
12
+ // CHECK: [indexDeclaration]: kind: objc-instance-method | name: p1_method | {{.*}} | loc: {{.*}}hidden-redecls-sub.h:3:9 | {{.*}} | isRedecl: 1
You can’t perform that action at this time.
0 commit comments