-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Remove redundant condition for invoking move ctor #77893
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
|
@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 fine to merge, but I wonder if we should just delete the line that follows as it is already commented out. Or was the radar related to the deleted ctor?
|
The rdar was about uncommenting the commented out line but did not provide any context what is blocking us from doing that. |
|
Okay. Note that you do still have that line in the code about move constructors, and it's weird to be using different rules for them. I was hoping the explanatory comment was going to be something like "There's a bug in how we interact with the fact that C++ does blah blah blah with inline copy constructors, so don't require a body for now". If we really don't know why we had that condition in the first place, I tend to agree with Saleem that we should just remove it (in both places). Abstractly, I certainly don't see any reason why we would only look for constructors defined inline in the class, which seems to be what this condition is doing, so if there's a reason we do need to do that, it deserves a real comment regardless. |
I agree with everything you said. Unfortunately, I looked at the commit that introduced this code and the rdar that was linked but none of them provided the context why the two methods are not symmetric. I will give removing this call in both places a try and see if anything breaks. |
b2c6493 to
d9c5648
Compare
There is no reason to require a body for move/copy ctors to use them.
d9c5648 to
f1ac9af
Compare
|
@swift-ci please test |
|
@swift-ci please test |
There is no reason to require a body for move/copy ctors to use them.