File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
test/Interop/SwiftToCxx/stdlib Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,9 @@ class ClangTypeHandler {
134134 if (auto *record = dyn_cast<clang::CXXRecordDecl>(typeDecl))
135135 return record->isTrivial ();
136136
137- // FIXME: If we can get plain clang::RecordDecls here, we need to figure out
138- // how nontrivial (i.e. ARC) fields work.
139- assert (!isa<clang::RecordDecl>(typeDecl) );
137+ // Structs with ARC members are not considered trivial.
138+ if ( auto *record = dyn_cast<clang::RecordDecl>(typeDecl))
139+ return !record-> hasObjectMember ( );
140140
141141 // C-family enums are always trivial.
142142 return isa<clang::EnumDecl>(typeDecl);
Original file line number Diff line number Diff line change 66// REQUIRES: objc_interop
77
88import CoreFoundation
9+ import Foundation
910
1011public func foobar( _ a: CFData ) -> Bool {
1112 true
1213}
1314
15+ public func networkThing( ) -> in_addr ? {
16+ return nil
17+ }
18+
1419// CHECK: SWIFT_EXTERN bool $s17UseCoreFoundation6foobarySbSo9CFDataRefaF(CFDataRef _Nonnull a) SWIFT_NOEXCEPT SWIFT_CALL; // foobar(_:)
20+ // CHECK: SWIFT_INLINE_THUNK swift::Optional<in_addr> networkThing() noexcept SWIFT_SYMBOL("s:17UseCoreFoundation12networkThingSo7in_addrVSgyF") SWIFT_WARN_UNUSED_RESULT {
You can’t perform that action at this time.
0 commit comments