swift
ec506f82 - [cxx-interop] Fix swift::Type to clang::QualType conversion to correctly handle foreign reference types

Commit
1 year ago
[cxx-interop] Fix swift::Type to clang::QualType conversion to correctly handle foreign reference types For types imported from C++, the original clang::TypeDecl is saved in the swift::Type and reused for conversions back to clang::QualType. However, the conversion did not account for foreign reference types, which should be mapped to a pointer to the C++ record type, rather than the record type itself. This bug first appeared as a function template instantiation failure due to a sanity check performed by SwiftDeclConverter::foreignReferenceTypePassedByRef() but may also affect other round-tripping type conversions. The added test case demonstrates the template instantiation scenario, where templates were being used to overcome Swift/C++ interop's current lack of support for class inheritance. rdar://134979343
Author
Committer
Parents
Loading