[flang-commits] [flang] [flang][OpenMP] Switch SOURCE/SINK to use modifier infrastructure (PR #217644)

Caroline Newcombe via flang-commits flang-commits at lists.llvm.org
Thu Aug 20 09:47:01 PDT 2026


================
@@ -3010,8 +3015,9 @@ void OmpStructureChecker::CheckOrderedDependClause(
     std::optional<int64_t> orderedValue) {
   auto visitDoacross{[&](const parser::OmpDoacross &doa,
                          const parser::CharBlock &src) {
-    if (auto *sinkVector{std::get_if<parser::OmpDoacross::Sink>(&doa.u)}) {
-      int64_t numVar = sinkVector->v.v.size();
+    auto &iterVec{std::get<std::optional<parser::OmpIterationVector>>(doa.t)};
+    if (iterVec) {
----------------
cenewcombe wrote:

I think a malformed `SOURCE: vector` input could also reach here (although correctly caught elsewhere). I'd suggest restricting this to `SINK` so we don't produce a confusing diagnostic. You could also add a regression test around this in `ordered01.f90`, e.g.:
```
!ERROR: Iteration vector may not be specified with SOURCE dependence type
!$omp ordered depend(source: i - 2, i - 3)
```

https://github.com/llvm/llvm-project/pull/217644


More information about the flang-commits mailing list