This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Create a new local variable in visitLambdaExpr()
AbandonedPublic

Authored by tbaeder on Jun 23 2023, 12:58 AM.

Details

Summary
Move the logic for initialization of a lambda into
visitRecordInitializer(). When we visit a LambdaExpr outside of the
visitInitializer() logic, we need to create a new local variable so we
have a place to write the lambda members into.

This fixes passing lambas as arguments to function calls.

In that case, we visit a LambdaExpr without it being an initializer to anything, so we should create a new local variable and return a pointer to it, which we then pass to the function call.

Diff Detail