File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -8303,6 +8303,9 @@ static bool hasMoveTypeOperations(const clang::CXXRecordDecl *decl) {
83038303}
83048304
83058305static bool hasDestroyTypeOperations (const clang::CXXRecordDecl *decl) {
8306+ if (decl->hasSimpleDestructor ())
8307+ return true ;
8308+
83068309 if (auto dtor = decl->getDestructor ()) {
83078310 if (dtor->isDeleted () || dtor->isIneligibleOrNotSelected () ||
83088311 dtor->getAccess () != clang::AS_public) {
Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ struct SWIFT_NONCOPYABLE NonCopyableNonMovable { // expected-note {{record 'NonC
7979 NonCopyableNonMovable ( NonCopyableNonMovable&& other) = delete;
8080} ;
8181
82+ template < typename T> struct SWIFT_COPYABLE_IF( T) DisposableContainer { } ;
83+ struct POD { int x; float y; } ; // special members are implicit, but should be copyable
84+ using DisposablePOD = DisposableContainer < POD > ; // should also be copyable
8285
8386//--- test.swift
8487import Test
@@ -129,3 +132,7 @@ func missingLifetimeOperation() {
129132 let s = NonCopyableNonMovable ( ) // expected-error {{cannot find 'NonCopyableNonMovable' in scope}}
130133 takeCopyable ( s)
131134}
135+
136+ func copyableDisposablePOD( p: DisposablePOD ) {
137+ takeCopyable ( p)
138+ }
You can’t perform that action at this time.
0 commit comments