================ @@ -4126,7 +4126,11 @@ static bool isTemplateArgumentTemplateParameter(const TemplateArgument &Arg, return false; const NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(DRE->getDecl()); - return NTTP && NTTP->getDepth() == Depth && NTTP->getIndex() == Index; + if (!NTTP || NTTP->getDepth() != Depth || NTTP->getIndex() != Index) + return false; + QualType ParamType = cast<NonTypeTemplateParmDecl>(Param)->getType(); + QualType NTTPType = NTTP->getType(); + return ParamType.getCanonicalType() == NTTPType.getCanonicalType(); ---------------- mizvekov wrote:
Yeah what you said makes sense, they are not the same parameter. But if this is worried specifically about a parameter from the primary template, that could be tested for instead, along with its index. The function has a single user, so you can probably change it however and rename it, or move the test to the user and then remove the function seems fine to me as well. https://github.com/llvm/llvm-project/pull/152864 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits