Skip to content

Fix error caused by reference to local binding #151789

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

Merged
merged 1 commit into from
Aug 2, 2025

Conversation

asudarsa
Copy link
Contributor

@asudarsa asudarsa commented Aug 2, 2025

This change fixes one of the failures in #147321

Following code snippet:
for (const auto &[CategoryName, PropSet] : PSRegistry) { J.attributeObject(CategoryName, [&] { for (const auto &[PropName, PropVal] : PropSet) {
causes a build warning that is emitted as an error.
error: reference to local binding 'PropSet' declared in enclosing lambda expression

This is resolved by capturing PropSet in a local variable.

Thanks

@asudarsa asudarsa merged commit ee67f78 into llvm:main Aug 2, 2025
10 checks passed
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.

2 participants