Skip to content

[cxx-interop] Do not import inherited methods with rvalue this #69746

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
Nov 9, 2023

Conversation

egorzhdan
Copy link
Contributor

We do not synthesize the inheritance thunks correctly for such methods. Do not try to synthesize them, as that causes issues when there are two overloads of the same method, one with rvalue this and one without.

<unknown>:0: error: 'this' argument to member function 'rvalueThisInBase' is an lvalue, but function has rvalue ref-qualifier
functions.h:25:22: note: 'rvalueThisInBase' declared here
  inline const char *rvalueThisInBase() const&&
                     ^
<unknown>:0: error: failed to synthesize call to the base method 'rvalueThisInBase()' of type 'rvalueThisInBase()'
<unknown>:0: error: missing return in instance method expected to return 'UnsafePointer<CChar>?' (aka 'Optional<UnsafePointer<Int8>>')

The proper solution is tracked as #69745

Unblocks rdar://114282353 / #69623

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Nov 9, 2023
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan enabled auto-merge November 9, 2023 12:58
We do not synthesize the inheritance thunks correctly for such methods. Do not try to synthesize them, as that causes issues when there are two overloads of the same method, one with rvalue this and one without.

The proper solution is tracked as #69745

Unblocks rdar://114282353
@egorzhdan egorzhdan force-pushed the egorzhdan/avoid-rvalue-this-inheritance branch from 99f542a to f9bf957 Compare November 9, 2023 13:43
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan merged commit 6dafae8 into main Nov 9, 2023
@egorzhdan egorzhdan deleted the egorzhdan/avoid-rvalue-this-inheritance branch November 9, 2023 16:17
hjyamauchi added a commit to hjyamauchi/swift that referenced this pull request Nov 13, 2024
We do not synthesize the inheritance thunks correctly for such methods. Do not try to synthesize them, as that causes issues when there are two overloads of the same method, one with rvalue this and one without.

The proper solution is tracked as swiftlang#69745

Unblocks rdar://114282353

Cherrypick commit f9bf957
Cherrypick PR swiftlang#69746
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.

1 participant