Skip to content

[cxx-interop] Use unique mangling for distinct C++ class template specializations #69408

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
Oct 26, 2023

Conversation

egorzhdan
Copy link
Contributor

This makes sure we are printing more than one level of C++ template specializations when emitting a Swift struct name.

For instance, std::__wrap_iter<char*> and std::__wrap_iter<const char*> are currently imported with the same name in Swift. This means the mangled string will be the same for these specializations, despite them being distinct types. This causes mangling errors.

rdar://117485399

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

@swift-ci please smoke test

…cializations

This makes sure we are printing more than one level of C++ template specializations when emitting a Swift struct name.

For instance, `std::__wrap_iter<char*>` and `std::__wrap_iter<const char*>` are currently imported with the same name in Swift. This means the mangled string will be the same for these specializations, despite them being distinct types. This causes mangling errors.

rdar://117485399
@egorzhdan egorzhdan force-pushed the egorzhdan/deep-template-mangling branch from b7c9cfe to a45d03a Compare October 26, 2023 12:30
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@hyp hyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

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.

2 participants