Skip to content

[Clang] Introduce FunctionParmPackDecl for expanded lambda captures #107995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zyn0217
Copy link
Contributor

@zyn0217 zyn0217 commented Sep 10, 2024

This patch continues the effort of #86265, fixing another issue involving expanded captures that were not able to held off in the process of the inner lambda's transformation.

Similar to FunctionParmPackExpr, FunctionParmPackDecl is introduced to model expanded parameters (particularly, lambda parameters) in the situation where the expansion shouldn't occur in the subsequent transformation. This node acts as an intermediate Decl and thus should not show up in the eventual AST.

Fixes #18873

Copy link
Collaborator

@erichkeane erichkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me, and the code itself is fine. I wouldn't mind a few of the others getting a chance to make a comment on it, and for me myself to consider the implications of it. So this just needs time to bake in my head.

@cor3ntin
Copy link
Contributor

@zyn0217 are you still working on that?

@zyn0217
Copy link
Contributor Author

zyn0217 commented Mar 14, 2025

@cor3ntin I thought introducing a new Decl node only to ensure the invariance of the protocol of TransformDecl() seemed a bit waste, but I don't know if there's a better approach, so I left it as a draft.

Do we have this issue surfaced recently other than the original one?

@cor3ntin
Copy link
Contributor

Do we have this issue surfaced recently other than the original one?

#18873 (comment)

@cor3ntin
Copy link
Contributor

@cor3ntin I thought introducing a new Decl node only to ensure the invariance of the protocol of TransformDecl() seemed a bit waste, but I don't know if there's a better approach, so I left it as a draft.

This looks like a reasonable approach to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested Variadic Expansions in generic lambdas don't work
3 participants