Skip to content

🍒[cxx-interop] Handle inherited templated operators during auto-conformance #67373

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
Jul 19, 2023

Conversation

egorzhdan
Copy link
Contributor

@egorzhdan egorzhdan commented Jul 18, 2023

Explanation: This fixes the automatic std::unordered_map conformance to CxxDictionary on Linux. Previously std::unordered_map::const_iterator was not auto-conformed to UnsafeCxxInputIterator because its operator== is defined on a templated base class of const_iterator.
Scope: This adjusts the auto-conformance logic of C++ types to Swift protocols.
Risk: Low, this only takes effect when C++ interop is enabled.

Original PR: #67287

rdar://105220600
(cherry picked from commit bc56ddc)

…mance

This fixes the automatic `std::unordered_map` conformance to CxxDictionary on Linux. Previously `std::unordered_map::const_iterator` was not auto-conformed to UnsafeCxxInputIterator because its `operator==` is defined on a templated base class of `const_iterator`.

rdar://105220600
(cherry picked from commit bc56ddc)
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jul 18, 2023
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan egorzhdan marked this pull request as ready for review July 18, 2023 18:21
@egorzhdan egorzhdan requested a review from a team as a code owner July 18, 2023 18:21
Copy link
Contributor

@ravikandhadai ravikandhadai left a comment

Choose a reason for hiding this comment

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

Thanks Egor.

@ravikandhadai ravikandhadai merged commit 24d21f9 into release/5.9 Jul 19, 2023
@ravikandhadai ravikandhadai deleted the egorzhdan/5.9-cxx-equal-equal branch July 19, 2023 21:20
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