-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Synthesize conformances to UnsafeCxxInputIterator
#60001
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
Conversation
I will need to add more tests. |
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so awesome!! Thanks Egor.
a0a02ab
to
6d7f03f
Compare
@swift-ci please smoke test |
bebaf33
to
727606e
Compare
@swift-ci please smoke test |
727606e
to
f73b027
Compare
@swift-ci please smoke test |
return; | ||
|
||
// Check if present: `func ==` | ||
// FIXME: this only detects `operator==` declared as a member. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will address this in a separate patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you define bool operator==(const A& lhs, const A& rhs)
out of the class definition, the lookup won't find this decl (which is OK, we just need to handle it differently here)
f73b027
to
0c3edb8
Compare
@swift-ci please smoke test |
@swift-ci please smoke test macOS |
This teaches ClangImporter to synthesize conformances of C++ iterator types to `UnsafeCxxInputIterator` protocol from the `Cxx` module. We consider a C++ type to be an iterator if it defines a subtype (usually a typedef or a using decl) called `iterator_category` that inherits from `std::input_iterator_tag`. rdar://96235368
0c3edb8
to
d85d2e9
Compare
@swift-ci please smoke test |
This teaches ClangImporter to synthesize conformances of C++ iterator types to
UnsafeCxxInputIterator
protocol from theCxx
module.We consider a C++ type to be an iterator if it defines a subtype (usually a typedef or a using decl) called
iterator_category
that inherits fromstd::input_iterator_tag
.rdar://96235368