Skip to content

Commit 80f9eae

Browse files
sdkrystianalandefreitas
authored andcommitted
fix: fallback to TemplateName::print for qualified template names
1 parent d2990a8 commit 80f9eae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/lib/AST/ASTVisitor.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,12 @@ class ASTVisitor
11451145
{
11461146
auto R = std::make_unique<TemplateTArg>();
11471147
R->IsPackExpansion = A.isPackExpansion();
1148+
1149+
// KRYSTIAN FIXME: template template arguments are
1150+
// id-expression, so we don't properly support them yet.
1151+
// for the time being, we will use the name & SymbolID of
1152+
// the referenced declaration (if it isn't dependent),
1153+
// and fallback to printing the template name otherwise
11481154
TemplateName TN = A.getAsTemplateOrTemplatePattern();
11491155
if(auto* TD = TN.getAsTemplateDecl())
11501156
{
@@ -1161,6 +1167,12 @@ class ASTVisitor
11611167
getOrBuildInfo(D);
11621168
}
11631169
}
1170+
else
1171+
{
1172+
llvm::raw_string_ostream stream(R->Name);
1173+
TN.print(stream, context_.getPrintingPolicy(),
1174+
TemplateName::Qualified::AsWritten);
1175+
}
11641176
return R;
11651177
}
11661178
// nullptr value

0 commit comments

Comments
 (0)