Skip to content
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

[cxx-interop] Add a SWIFT_MUTATING macro to <swift/bridging> header #66322

Closed
Tracked by #65808
hyp opened this issue Jun 4, 2023 · 1 comment · Fixed by #66374
Closed
Tracked by #65808

[cxx-interop] Add a SWIFT_MUTATING macro to <swift/bridging> header #66322

hyp opened this issue Jun 4, 2023 · 1 comment · Fixed by #66374
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. c++ interop Feature: Interoperability with C++ swift 5.9 triage needed This issue needs more specific labels

Comments

@hyp
Copy link
Contributor

hyp commented Jun 4, 2023

This macro is needed to allow users to annotate constant C++ member functions that do mutate the object, e.g. using a mutable C++ field. This annotation makes Swift import them as mutating methods then.

Note: the compiler already supports it using the swift_attr("mutating") attribute, now we just need a macro. You can use __attribute__((swift_attr("mutating"))) for now to workaround this issue.

@hyp hyp added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. c++ interop Feature: Interoperability with C++ triage needed This issue needs more specific labels swift 5.9 labels Jun 4, 2023
@hyp hyp self-assigned this Jun 4, 2023
@hyp hyp changed the title [cxx-interop] Add a SWIFT_MUTATING macro [cxx-interop] Add a SWIFT_MUTATING macro to <swift/bridging> header Jun 4, 2023
hyp added a commit to hyp/swift that referenced this issue Jun 6, 2023
@hyp hyp closed this as completed in #66374 Jun 6, 2023
@hyp
Copy link
Contributor Author

hyp commented Jun 6, 2023

Need to land in 5.9 still

hyp added a commit to hyp/swift that referenced this issue Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. c++ interop Feature: Interoperability with C++ swift 5.9 triage needed This issue needs more specific labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant