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 {
134
134
if (auto *record = dyn_cast<clang::CXXRecordDecl>(typeDecl))
135
135
return record->isTrivial ();
136
136
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 ( );
140
140
141
141
// C-family enums are always trivial.
142
142
return isa<clang::EnumDecl>(typeDecl);
Original file line number Diff line number Diff line change 6
6
// REQUIRES: objc_interop
7
7
8
8
import CoreFoundation
9
+ import Foundation
9
10
10
11
public func foobar( _ a: CFData ) -> Bool {
11
12
true
12
13
}
13
14
15
+ public func networkThing( ) -> in_addr ? {
16
+ return nil
17
+ }
18
+
14
19
// 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