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 @@ -884,12 +884,11 @@ void Sema::ProcessAPINotes(Decl *D) {
884
884
885
885
return ;
886
886
}
887
-
888
- return ;
889
887
}
890
888
891
889
// Enumerators.
892
- if (D->getDeclContext ()->getRedeclContext ()->isFileContext ()) {
890
+ if (D->getDeclContext ()->getRedeclContext ()->isFileContext () ||
891
+ D->getDeclContext ()->getRedeclContext ()->isExternCContext ()) {
893
892
if (auto EnumConstant = dyn_cast<EnumConstantDecl>(D)) {
894
893
for (auto Reader : APINotes.findAPINotes (D->getLocation ())) {
895
894
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