File tree Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -873,12 +873,11 @@ void Sema::ProcessAPINotes(Decl *D) {
873
873
874
874
return ;
875
875
}
876
-
877
- return ;
878
876
}
879
877
880
878
// Enumerators.
881
- if (D->getDeclContext ()->getRedeclContext ()->isFileContext ()) {
879
+ if (D->getDeclContext ()->getRedeclContext ()->isFileContext () ||
880
+ D->getDeclContext ()->getRedeclContext ()->isExternCContext ()) {
882
881
if (auto EnumConstant = dyn_cast<EnumConstantDecl>(D)) {
883
882
for (auto Reader : APINotes.findAPINotes (D->getLocation ())) {
884
883
auto Info = Reader->lookupEnumConstant (EnumConstant->getName ());
Original file line number Diff line number Diff line change 2
2
Name: CxxInterop
3
3
Classes:
4
4
- Name: NSSomeClass
5
- SwiftName: SomeClass
5
+ SwiftName: SomeClass
6
+ Enumerators:
7
+ - Name: SomeClassRed
8
+ SwiftName: red
Original file line number Diff line number Diff line change 1
1
@interface NSSomeClass
2
2
-(instancetype )init;
3
- @end
3
+ @end
4
+
5
+ // Named "SomeClassRed" for ast node filtering in the test.
6
+ enum ColorEnum { SomeClassRed, SomeClassGreen, SomeClassBlue };
Original file line number Diff line number Diff line change 6
6
7
7
// CHECK: Dumping NSSomeClass:
8
8
// CHECK-NEXT: ObjCInterfaceDecl {{.+}} imported in CxxInteropKit <undeserialized declarations> NSSomeClass
9
- // CHECK-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "SomeClass"
9
+ // CHECK-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "SomeClass"
10
+
11
+ // CHECK: Dumping SomeClassRed:
12
+ // CHECK-NEXT: EnumConstantDecl {{.+}} imported in CxxInteropKit SomeClassRed 'ColorEnum'
13
+ // CHECK-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "red"
You can’t perform that action at this time.
0 commit comments