Skip to content

[cxx-interop] Support conditional escapability #77588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

Xazax-hun
Copy link
Contributor

This PR adds a variadic macro that builds a SwiftAttr string containing the names of the template type parameters that need to be escapable for the type to be considered escapable. It also adds logic to interpret this annotation.

rdar://139065437

@Xazax-hun Xazax-hun added the c++ interop Feature: Interoperability with C++ label Nov 13, 2024
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@@ -37,6 +37,30 @@ View g(int* x) {
return View(x);
}

template<typename F, typename S>
struct SWIFT_ESCAPABLE_IF(F, S) MyPair {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not support nested templates yet. I plan to do that in a follow-up PR.

Copy link
Contributor

@egorzhdan egorzhdan left a comment

Choose a reason for hiding this comment

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

LGTM with a couple of very minor comments

This PR adds a variadic macro that builds a SwiftAttr string containing
the names of the template type parameters that need to be escapable for
the type to be considered escapable. It also adds logic to interpret
this annotation.

rdar://139065437
@Xazax-hun Xazax-hun force-pushed the gaborh/conditional-escapability branch from 585396b to 558380f Compare November 15, 2024 14:28
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun Xazax-hun enabled auto-merge November 15, 2024 15:28
@Xazax-hun Xazax-hun merged commit 5b2f3b7 into main Nov 15, 2024
3 checks passed
@Xazax-hun Xazax-hun deleted the gaborh/conditional-escapability branch November 15, 2024 18:26
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.

3 participants