mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[interop][SwiftToCxx] moving a Swift class in C++ performs a copy
C++ does not have a consuming move, so fallback to copy instead Resolves https://github.com/apple/swift/issues/64702
This commit is contained in:
@@ -95,6 +95,17 @@ int main() {
|
||||
// CHECK-NEXT: useDerivedClass, type=Class.DerivedDerivedClass
|
||||
// CHECK-NEXT: destroy DerivedDerivedClass
|
||||
// CHECK-NEXT: destroy DerivedClass
|
||||
// CHECK-NEXT: destroy BaseClass
|
||||
|
||||
{
|
||||
BaseClass x = returnDerivedClass();
|
||||
assert(getRetainCount(x) == 1);
|
||||
useBaseClass(x);
|
||||
}
|
||||
// CHECK-NEXT: init BaseClass
|
||||
// CHECK-NEXT: init DerivedClass
|
||||
// CHECK-NEXT: useBaseClass, type=Class.DerivedClass
|
||||
// CHECK-NEXT: destroy DerivedClass
|
||||
// CHECK-NEXT: destroy BaseClass
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user