Skip to content

Conversation

susmonteiro
Copy link
Contributor

If a C++ type doesn't have a user provided copy constructor, Clang will declare one implicitly, unless one of its fields is not copy-constructible. Clang assumes that any std::vector is always copy-constructible, including a std::vector of a non-copy constructible type. So, let's use the CxxValueSemantics implemented in #84340 to figure out if we should ask Clang to define the copy constructor for such types.

This also includes types that have a defaulted, user-provided copy constructor.

rdar://151870709

@susmonteiro susmonteiro requested a review from zoecarver as a code owner October 2, 2025 13:49
@susmonteiro susmonteiro added the c++ interop Feature: Interoperability with C++ label Oct 2, 2025
@susmonteiro susmonteiro force-pushed the susmonteiro/implicit-copy-constructors branch from 4b41375 to 73d4c7c Compare October 2, 2025 14:07
@susmonteiro
Copy link
Contributor Author

@swift-ci please smoke test

@susmonteiro susmonteiro force-pushed the susmonteiro/implicit-copy-constructors branch from 73d4c7c to 266be88 Compare October 3, 2025 13:03
@susmonteiro
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@Xazax-hun Xazax-hun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@susmonteiro susmonteiro enabled auto-merge October 3, 2025 13:47
@Xazax-hun
Copy link
Contributor

@swift-ci please smoke test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ interop Feature: Interoperability with C++

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants