[clang] [OpenMP] Support capturing structured bindings in OpenMP regions. (PR #190832)
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 17 13:59:59 PDT 2026
================
@@ -3738,6 +3738,25 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
if (const auto *BD = dyn_cast<BindingDecl>(ND)) {
if (E->refersToEnclosingVariableOrCapture()) {
auto *FD = LambdaCaptureFields.lookup(BD);
+ if (!FD) {
+ // OpenMP case: binding was captured via its decomposed decl.
+ if (auto *DD = dyn_cast<VarDecl>(BD->getDecomposedDecl())) {
----------------
alexey-bataev wrote:
This is bad approach. Instead you should get decomposed decl immediately and check it without accessing LambdaCaptureFields for BD. You changed the way of the capture, so just no need to check the BD
https://github.com/llvm/llvm-project/pull/190832
More information about the cfe-commits
mailing list