[clang] [Clang] Follow up to previous lambda-in-concept patch (PR #210381)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 18 07:56:38 PDT 2026
================
@@ -3761,13 +3761,17 @@ Decl *TemplateDeclInstantiator::VisitNonTypeTemplateParmDecl(
if (IsExpandedParameterPack)
Param = NonTypeTemplateParmDecl::Create(
SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
- D->getDepth() - TemplateArgs.getNumSubstitutedLevels(),
+ D->getDepth() - (TemplateArgs.retainInnerDepths()
+ ? 0
+ : TemplateArgs.getNumSubstitutedLevels()),
D->getPosition(), D->getIdentifier(), T, TSI,
ExpandedParameterPackTypes, ExpandedParameterPackTypesAsWritten);
else
Param = NonTypeTemplateParmDecl::Create(
SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
- D->getDepth() - TemplateArgs.getNumSubstitutedLevels(),
+ D->getDepth() - (TemplateArgs.retainInnerDepths()
+ ? 0
+ : TemplateArgs.getNumSubstitutedLevels()),
----------------
erichkeane wrote:
I agree with @cor3ntin . This is imperfect, but I think this is a about as good as we can do without some high risk changes.
While in my lifetime I'd love to see a replacement way to do template instantation/the whole rewrite it would be to do this 'right', I think this is a 'good as it gets' for now. So, ship it.
https://github.com/llvm/llvm-project/pull/210381
More information about the cfe-commits
mailing list