File tree 5 files changed +37
-4
lines changed
5 files changed +37
-4
lines changed Original file line number Diff line number Diff line change @@ -950,7 +950,8 @@ ObjCMethodDecl *ObjCMethodDecl::getNextRedeclarationImpl() {
950
950
if (!Redecl && isRedeclaration ()) {
951
951
// This is the last redeclaration, go back to the first method.
952
952
return cast<ObjCContainerDecl>(CtxD)->getMethod (getSelector (),
953
- isInstanceMethod ());
953
+ isInstanceMethod (),
954
+ /* AllowHidden=*/ true );
954
955
}
955
956
956
957
return Redecl ? Redecl : this ;
@@ -983,7 +984,8 @@ ObjCMethodDecl *ObjCMethodDecl::getCanonicalDecl() {
983
984
if (isRedeclaration ()) {
984
985
// It is possible that we have not done deserializing the ObjCMethod yet.
985
986
ObjCMethodDecl *MD =
986
- cast<ObjCContainerDecl>(CtxD)->getMethod (Sel, isInstanceMethod ());
987
+ cast<ObjCContainerDecl>(CtxD)->getMethod (Sel, isInstanceMethod (),
988
+ /* AllowHidden=*/ true );
987
989
return MD ? MD : this ;
988
990
}
989
991
@@ -1308,8 +1310,9 @@ void ObjCMethodDecl::getOverriddenMethods(
1308
1310
const ObjCMethodDecl *Method = this ;
1309
1311
1310
1312
if (Method->isRedeclaration ()) {
1311
- Method = cast<ObjCContainerDecl>(Method->getDeclContext ())->
1312
- getMethod (Method->getSelector (), Method->isInstanceMethod ());
1313
+ Method = cast<ObjCContainerDecl>(Method->getDeclContext ())
1314
+ ->getMethod (Method->getSelector (), Method->isInstanceMethod (),
1315
+ /* AllowHidden=*/ true );
1313
1316
}
1314
1317
1315
1318
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