Skip to content

Commit 7c63cd4

Browse files
committed
[cxx-interop] Emit _ as a fallback type name in template params
Emit an underscore instead of an empty type name when we weren't able to emit a more meaningful representation of a C++ template parameter in Swift.
1 parent 2061640 commit 7c63cd4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/ClangImporter/ClangClassTemplateNamePrinter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ struct TemplateInstantiationNamePrinter
2828
ImportNameVersion version)
2929
: swiftCtx(swiftCtx), nameImporter(nameImporter), version(version) {}
3030

31+
std::string VisitType(const clang::Type *type) {
32+
// Print "_" as a fallback if we couldn't emit a more meaningful type name.
33+
return "_";
34+
}
35+
3136
std::string VisitBuiltinType(const clang::BuiltinType *type) {
3237
Type swiftType = nullptr;
3338
switch (type->getKind()) {

0 commit comments

Comments
 (0)