================
@@ -8462,6 +8466,18 @@ bool OpenMPIterationSpaceChecker::checkAndSetInit(Stmt
*S, bool EmitDiags) {
}
}
+ // Helper lambda to check if a loop variable is already used in an outer
+ // loop.
+ auto CheckLoopVarReuse = [&](ValueDecl *LoopVar, SourceLocation Loc) -> bool
{
----------------
zahiraam wrote:
I have tried this: https://godbolt.org/z/q3ahz9dEq but it's not compiling.
Would this be acceptable?
```
void test_canonical_decl_reuse(int *out) {
int storage = 0;
int &r = storage;
#pragma omp parallel for collapse(2)
for (r = 0; r < 4; ++r) {
for (r = 0; r < 4; ++r) {
out[r] = r;
}
}
}
```
https://github.com/llvm/llvm-project/pull/203252
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits