[clang] [clang][AST] Pretty-print default template template args (PR #162134)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 6 12:31:16 PDT 2025
================
@@ -1190,7 +1190,11 @@ void DeclPrinter::printTemplateParameters(const TemplateParameterList *Params,
VisitNonTypeTemplateParmDecl(NTTP);
} else if (auto TTPD = dyn_cast<TemplateTemplateParmDecl>(Param)) {
VisitTemplateDecl(TTPD);
- // FIXME: print the default argument, if present.
+ if (TTPD->hasDefaultArgument() && !TTPD->defaultArgumentWasInherited()) {
+ Out << " = ";
+ TTPD->getDefaultArgument().getArgument().print(Policy, Out,
+ /*IncludeType=*/false);
+ }
----------------
mizvekov wrote:
Yeah the other cases are in pretty much the same situation, and they are also only used here.
Either moving all of them inline, or moving this one to a likewise separate function seems fine to me.
https://github.com/llvm/llvm-project/pull/162134
More information about the cfe-commits
mailing list