[clang] [Clang] fix crash with generic lambdas in function default args (PR #222987)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 14 19:49:09 PDT 2026
================
@@ -7756,6 +7756,12 @@ void Parser::ParseParameterDeclarationClause(
DelayTemplateIdDestructionRAII DontDestructTemplateIds(
*this, /*DelayTemplateIdDestruction=*/true);
+ TemplateParameterDepthRAII CurTemplateDepthTracker(
+ TemplateParameterDepth);
+ unsigned Depth = Actions.getTemplateDepth(getCurScope());
+ if (Depth > TemplateParameterDepth)
+ CurTemplateDepthTracker.addDepth(Depth - TemplateParameterDepth);
----------------
zyn0217 wrote:
I'm a bit concerned about the depth of the TTP in lambda, can you also add tests where those NTTP/TTP are deduced from its call? e.g.
`[](auto x) { return x; }(123)` etc
https://github.com/llvm/llvm-project/pull/222987
More information about the cfe-commits
mailing list