Skip to content

Conversation

@susmonteiro
Copy link
Contributor

@susmonteiro susmonteiro commented Nov 18, 2025

This patch reapplies #84646 and #85236:

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.

These patches were reverted (#85331) because they triggered a cycle in the CxxValueSemantics requests. After #85485, these cycles have been prevented and we can safely re-land those patches.

rdar://151870709
rdar://152496447

@susmonteiro susmonteiro added the c++ interop Feature: Interoperability with C++ label Nov 18, 2025
@susmonteiro
Copy link
Contributor Author

@swift-ci please smoke test

@susmonteiro susmonteiro force-pushed the susmonteiro/reapply-implicit-constructors branch from 39b6e3b to b7292a7 Compare November 18, 2025 16:00
@susmonteiro
Copy link
Contributor Author

@swift-ci please smoke test

@susmonteiro susmonteiro force-pushed the susmonteiro/reapply-implicit-constructors branch from ce6451b to 93ee8af Compare November 20, 2025 13:07
@susmonteiro
Copy link
Contributor Author

@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.

1 participant