-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Test symbolic interface generation for new features #73248
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 test |
This adds a test that ensures that a symbolic interface for a C++ module will include these features: * move-only types * virtual methods Default arguments are already tested. rdar://125816549
593a048
to
442f9c1
Compare
@swift-ci please test |
|
||
struct NonCopyable { | ||
NonCopyable(const NonCopyable& other) = delete; | ||
}; |
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.
Can we add a test with a private copy constructor? they should be imported as non-copyable right?
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.
And also a test with a non-default and explicitly defaulted move constructors?
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.
We have a test for these kinds of C++ types, type-classification-module-interface.swift
. Right now we don't import structs with private copy constructors, but you're right, we should be importing them as non-copyable in Swift. I'll put up a separate patch for that.
// CHECK: class MyImmortal { | ||
// CHECK-NEXT: func foo() | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: struct NonCopyable { |
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.
Shouldn't this need a conformance to ~Copyable
?
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.
swift-ide-test -print-module
doesn't explicitly print this conformance in the module interface
// CHECK-NEXT: } | ||
// CHECK-NEXT: struct NonCopyable { | ||
// CHECK-NEXT: @available(*, deprecated, message: | ||
// CHECK-NEXT: init() |
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.
Wondering why an availability printed for init()
here but not for other methods?
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 the deprecation annotation that we add to the synthesized zero-initializers, when the C++ struct doesn't have a default constructor
This adds a test that ensures that a symbolic interface for a C++ module will include these features:
Default arguments are already tested.
rdar://125816549