================
@@ -6371,6 +6376,70 @@ ASTContext::getCanonicalTemplateName(const TemplateName
&Name) const {
canonArgPack, subst->getAssociatedDecl()->getCanonicalDecl(),
subst->getFinal(), subst->getIndex());
}
+ case TemplateName::DeducedTemplate: {
+ assert(IgnoreDeduced == false);
+ DeducedTemplateStorage *DTS = Name.getAsDeducedTemplateName();
+ DefaultArguments DefArgs = DTS->getDefaultArguments();
+ TemplateName Underlying = DTS->getUnderlying();
+
+ bool NonCanonical = false;
+ TemplateName CanonUnderlying =
+ getCanonicalTemplateName(Underlying, /*IgnoreDeduced=*/true);
+ NonCanonical |= CanonUnderlying != Underlying;
+ auto CanonArgs =
+ getCanonicalTemplateArguments(*this, DefArgs.Args, NonCanonical);
+ {
+ unsigned NumArgs = CanonArgs.size() - 1;
+ auto handleParamDefArg = [&](const TemplateArgument &ParamDefArg,
+ unsigned I) {
+ auto CanonParamDefArg = getCanonicalTemplateArgument(ParamDefArg);
+ TemplateArgument &CanonDefArg = CanonArgs[I];
+ if (CanonDefArg.structurallyEquals(CanonParamDefArg))
+ return;
+ if (I == NumArgs)
+ CanonArgs.pop_back();
+ NonCanonical = true;
----------------
cor3ntin wrote:
I think this lambdas needs a comment, I'm not sure I understand what's
happening here
https://github.com/llvm/llvm-project/pull/94981
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits