File tree Expand file tree Collapse file tree 4 files changed +21
-21
lines changed Expand file tree Collapse file tree 4 files changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -3499,7 +3499,7 @@ namespace {
3499
3499
3500
3500
if (auto dtor = cxxRecordDecl->getDestructor ()) {
3501
3501
if (dtor->isDeleted () || dtor->getAccess () != clang::AS_public) {
3502
- result-> setIsCxxNonTrivial ( true ) ;
3502
+ return nullptr ;
3503
3503
}
3504
3504
}
3505
3505
}
Original file line number Diff line number Diff line change @@ -112,6 +112,17 @@ struct StructWithSubobjectPrivateDefaultedDestructor {
112
112
StructWithPrivateDefaultedDestructor subobject;
113
113
};
114
114
115
+ struct StructWithDeletedDestructor {
116
+ ~StructWithDeletedDestructor () = delete ;
117
+ };
118
+
119
+ struct StructWithInheritedDeletedDestructor
120
+ : StructWithDeletedDestructor {};
121
+
122
+ struct StructWithSubobjectDeletedDestructor {
123
+ StructWithDeletedDestructor subobject;
124
+ };
125
+
115
126
// Tests for common sets of special member functions.
116
127
117
128
struct StructTriviallyCopyableMovable {
Original file line number Diff line number Diff line change @@ -142,21 +142,6 @@ func pass(s: StructWithSubobjectDefaultedDestructor) {
142
142
// CHECK: bb0(%0 : $StructWithSubobjectDefaultedDestructor):
143
143
}
144
144
145
- // CHECK-LABEL: sil hidden [ossa] @$s4main4pass{{.*[ (]}}StructWithPrivateDefaultedDestructor)
146
- func pass( s: StructWithPrivateDefaultedDestructor ) {
147
- // CHECK: bb0(%0 : $*StructWithPrivateDefaultedDestructor):
148
- }
149
-
150
- // CHECK-LABEL: sil hidden [ossa] @$s4main4pass{{.*[ (]}}StructWithInheritedPrivateDefaultedDestructor)
151
- func pass( s: StructWithInheritedPrivateDefaultedDestructor ) {
152
- // CHECK: bb0(%0 : $*StructWithInheritedPrivateDefaultedDestructor):
153
- }
154
-
155
- // CHECK-LABEL: sil hidden [ossa] @$s4main4pass{{.*[ (]}}StructWithSubobjectPrivateDefaultedDestructor)
156
- func pass( s: StructWithSubobjectPrivateDefaultedDestructor ) {
157
- // CHECK: bb0(%0 : $*StructWithSubobjectPrivateDefaultedDestructor):
158
- }
159
-
160
145
// Tests for common sets of special member functions.
161
146
162
147
// CHECK-LABEL: sil hidden [ossa] @$s4main4pass{{.*[ (]}}StructTriviallyCopyableMovable)
@@ -173,8 +158,3 @@ func pass(s: StructNonCopyableTriviallyMovable) {
173
158
func pass( s: StructNonCopyableNonMovable ) {
174
159
// CHECK: bb0(%0 : $*StructNonCopyableNonMovable):
175
160
}
176
-
177
- // CHECK-LABEL: sil hidden [ossa] @$s4main4pass{{.*[ (]}}StructDeletedDestructor)
178
- func pass( s: StructDeletedDestructor ) {
179
- // CHECK: bb0(%0 : $*StructDeletedDestructor):
180
- }
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-ide-test -print-module -module-to-print=TypeClassification -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s
2
+
3
+ // Make sure we don't import objects that we can't destroy.
4
+ // CHECK-NOT: StructWithPrivateDefaultedDestructor
5
+ // CHECK-NOT: StructWithInheritedPrivateDefaultedDestructor
6
+ // CHECK-NOT: StructWithSubobjectPrivateDefaultedDestructor
7
+ // CHECK-NOT: StructWithDeletedDestructor
8
+ // CHECK-NOT: StructWithInheritedDeletedDestructor
9
+ // CHECK-NOT: StructWithSubobjectDeletedDestructor
You can’t perform that action at this time.
0 commit comments