Skip to content

Commit 791200b

Browse files
committed
[flang][OpenMP] Avoid captures of references to structured bindings
Handle one more case missed in ad37c8694e.
1 parent 38c1ff8 commit 791200b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

flang/lib/Lower/OpenMP.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,10 +2197,12 @@ static void genBodyOfTargetDataOp(
21972197
if (fir::isa_builtin_cptr_type(refType.getElementType())) {
21982198
converter.bindSymbol(*argSymbol, arg);
21992199
} else {
2200+
// Avoid capture of a reference to a structured binding.
2201+
const Fortran::semantics::Symbol *sym = argSymbol;
22002202
extVal.match(
22012203
[&](const fir::MutableBoxValue &mbv) {
22022204
converter.bindSymbol(
2203-
*argSymbol,
2205+
*sym,
22042206
fir::MutableBoxValue(
22052207
arg, fir::factory::getNonDeferredLenParams(extVal), {}));
22062208
},
@@ -2489,7 +2491,7 @@ static void genBodyOfTargetOp(
24892491
// Bind the symbols to their corresponding block arguments.
24902492
for (auto [argIndex, argSymbol] : llvm::enumerate(mapSymbols)) {
24912493
const mlir::BlockArgument &arg = region.getArgument(argIndex);
2492-
// Avoid capture of reference to a structured binding.
2494+
// Avoid capture of a reference to a structured binding.
24932495
const Fortran::semantics::Symbol *sym = argSymbol;
24942496
fir::ExtendedValue extVal = converter.getSymbolExtendedValue(*sym);
24952497
extVal.match(

0 commit comments

Comments
 (0)