[llvm-branch-commits] [flang] [llvm] [flang][OpenMP] Implement verification of modifier sets (PR #218507)

Michael Kruse via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 27 06:46:28 PDT 2026


================
@@ -1191,6 +1191,32 @@ bool OmpStructureChecker::VerifyModifierRequired(
       }
     }
   }
+  for (llvm::omp::ModifierSet s : cdesc.getModifierSets(version)) {
+    auto &sdesc{llvm::omp::getDescriptor(s)};
+    // Is group is required, at least one modifier from that group must be
+    // present.
+    if (sdesc.getProperties(version).test(llvm::omp::Property::Required)) {
+      bool present{false};
+      for (llvm::omp::Modifier m : sdesc.getModifiers(version)) {
+        if (isPresent(m)) {
+          present = true;
+          break;
+        }
+      }
+      if (!present) {
+        if (llvm::omp::isModifierGroup(s)) {
+          context_.Say(clause.source,
----------------
Meinersbur wrote:

This diagnostic does not have a test

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


More information about the llvm-branch-commits mailing list