Files
swift-mirror/test/Interop/Cxx/class/constructors-copy-module-interface.swift
Egor Zhdan fbbec48c76 [cxx-interop] Check the presence of copy constructor correctly
This removes a longstanding workaround in the import logic for C++ structs:
Swift assumed that if a C++ struct has no copy constructor that is explicitly deleted, then the struct is copyable. This is not actually correct. This replaces the workaround with a proper check for the presence of a C++ copy constructor.

rdar://136838485
2024-10-28 20:05:57 +00:00

9 lines
436 B
Swift

// RUN: %target-swift-ide-test -print-module -module-to-print=Constructors -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s
// CHECK: struct TemplatedCopyConstructor
// CHECK: struct TemplatedCopyConstructorWithExtraArg
// Make sure we don't import non-copyable types because we will have no way to
// represent and copy/move these in swift with correct semantics.
// CHECK-NOT: DeletedCopyConstructor