Skip to content

Conversation

@egorzhdan
Copy link
Contributor

Normally Swift imports T& operator* as var pointee: T. However, when the C++ operator has swift_name attribute attached to it, the importing was inconsistent: the renamed function was marked as deprecated, and an additional undesired overload was created.

For instance:

const std::string& operator*() const SWIFT_NAME(dereference());

was imported as an unavailable/deprecated func dereference(), and an additional overload of func *(_:) was created.

rdar://163500978

Normally Swift imports `T& operator*` as `var pointee: T`. However, when the C++ operator has `swift_name` attribute attached to it, the importing was inconsistent: the renamed function was marked as deprecated, and an additional undesired overload was created.

For instance:
```
const std::string& operator*() const SWIFT_NAME(dereference());
```
was imported as an unavailable/deprecated `func dereference()`, and an additional overload of `func *(_:)` was created.

rdar://163500978
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Dec 12, 2025
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test macOS

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.

4 participants