Skip to content

[cxx-interop] Support operator[] with multiple parameters #75803

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
Aug 9, 2024

Conversation

Xazax-hun
Copy link
Contributor

C++ only support multiparameter operator[] in C++23 and up. Change the code to protect such overloaded operators with a C++ language mode check.

rdar://133539699

C++ only support multiparameter operator[] in C++23 and up. Change the
code to protect such overloaded operators with a C++ language mode
check.

rdar://133539699
@Xazax-hun Xazax-hun added the c++ interop Feature: Interoperability with C++ label Aug 9, 2024
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.

Awesome, thanks!
I'm pretty sure on the forward interop side we would fail to import a C++ subscript with multiple parameters, but that shouldn't block this PR, I think

assert(getterImpl->getParameters()->size() == 1 &&
"subscript can only have 1 parameter");

@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun
Copy link
Contributor Author

Thanks! I opened rdar://133541125 so we do not forget the forward interop case.

@Xazax-hun Xazax-hun merged commit 3fc034b into main Aug 9, 2024
3 checks passed
@Xazax-hun Xazax-hun deleted the gaborh/subscript-multi-param branch August 9, 2024 18:31
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