[clang] [clang] Distinguish NTTPs with deduced types in variable template partial specializations (PR #152864)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 9 12:22:25 PDT 2025
================
@@ -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();
----------------
keinflue wrote:
Hm, after thinking about it, this change does mess with the original interpretation of the function and its name. I think I will move the test into its caller instead.
https://github.com/llvm/llvm-project/pull/152864
More information about the cfe-commits
mailing list