🍒[cxx-interop] Mangle numeric template arguments #67126
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: When mangling the name of a C++ template specialization, we ignored 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 the compiler adds the numeric arguments into the Swift type name, so they become a part of the mangled type name as well.
Scope: This alters the way templated C++ types with numeric template parameter are imported into Swift, specifically, it changes their type name as seen from Swift code.
Risk: Low, this only has an effect when C++ interop is enabled.
Original PR: #67101
rdar://107757051
(cherry picked from commit d4e8551)