Skip to content

[cxx-interop] Avoid linker errors for multiple instantiations of a templated struct with non-type parameters #66957

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

Closed
wants to merge 1 commit into from

Conversation

egorzhdan
Copy link
Contributor

When mangling the name of a C++ template specialization, we currently ignore non-type templated parameters. This causes two different instantiations of the same templated type to have the same mangled name, triggering linker errors.

This change makes sure we mangle all of the templated parameters by relying on Clang mangling logic.

rdar://107757051

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

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-template-mangling branch from 9a10336 to 9f51018 Compare June 28, 2023 16:28
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-template-mangling branch from 9f51018 to 043a120 Compare June 28, 2023 18:36
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

…mplated struct with non-type parameters

When mangling the name of a C++ template specialization, we currently ignore non-type templated parameter. This causes two different instantiations of the same templated type to have the same mangled name, triggering linker errors.

This change makes sure we mangle all of the templated parameters by relying on Clang mangling logic.

rdar://107757051
@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-template-mangling branch from 043a120 to b63e9ba Compare June 29, 2023 12:45
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

This is unnecessary after #67101

@egorzhdan egorzhdan closed this Jul 11, 2023
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