[flang-commits] [flang] [flang][OpenMP] Semantic checks for metadirective loop nests (PR #207088)

Abid Qadeer via flang-commits flang-commits at lists.llvm.org
Fri Jul 10 09:33:16 PDT 2026


================
@@ -43,6 +43,17 @@ using namespace Fortran::semantics::omp;
 void OmpStructureChecker::Enter(const parser::OmpClause::When &x) {
   OmpVerifyModifiers(
       x.v, llvm::omp::OMPC_when, GetContext().clauseSource, context_);
+  // Record this WHEN clause's context selector so the variant directive it
+  // controls can be paired with it for static-applicability matching.
+  if (const auto &modifiers{std::get<0>(x.v.t)};
+      modifiers && modifiers->size() == 1) {
----------------
abidh wrote:

A comment here on why  modifiers->size() == 1 check is needed would be helpful.

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


More information about the flang-commits mailing list