File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -6274,6 +6274,9 @@ static bool hasPointerInSubobjects(const clang::CXXRecordDecl *decl) {
62746274 hasUnsafeAPIAttr (cxxRecord))
62756275 return false ;
62766276
6277+ if (hasIteratorAPIAttr (cxxRecord) || isIterator (cxxRecord))
6278+ return true ;
6279+
62776280 if (hasPointerInSubobjects (cxxRecord))
62786281 return true ;
62796282 }
Original file line number Diff line number Diff line change @@ -197,4 +197,20 @@ struct HasUnsupportedUsingShadow : DependentParent<int> {
197197 using typename DependentParent<int >::Child;
198198};
199199
200+ struct __attribute__ ((swift_attr(" import_iterator" ))) Iterator {
201+ int idx;
202+ };
203+
204+ struct HasMethodThatReturnsIterator {
205+ Iterator getIterator () const ;
206+ };
207+
208+ struct IteratorBox {
209+ Iterator it;
210+ };
211+
212+ struct HasMethodThatReturnsIteratorBox {
213+ IteratorBox getIteratorBox () const ;
214+ };
215+
200216#endif // TEST_INTEROP_CXX_CLASS_INPUTS_TYPE_CLASSIFICATION_H
Original file line number Diff line number Diff line change 1818// CHECK-NOT: StructWithDeletedDestructor
1919// CHECK-NOT: StructWithInheritedDeletedDestructor
2020// CHECK-NOT: StructWithSubobjectDeletedDestructor
21+
22+ // CHECK: struct Iterator {
23+ // CHECK: }
24+
25+ // CHECK: struct HasMethodThatReturnsIterator {
26+ // CHECK: func __getIteratorUnsafe() -> Iterator
27+ // CHECK: }
28+
29+ // CHECK: struct IteratorBox {
30+ // CHECK: }
31+
32+ // CHECK: struct HasMethodThatReturnsIteratorBox {
33+ // CHECK: func __getIteratorBoxUnsafe() -> IteratorBox
34+ // CHECK: }
You can’t perform that action at this time.
0 commit comments