[flang-commits] [flang] [Flang][OpenMP] Fix crash when common block name is used in LINEAR clause (PR #203250)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Thu Jun 11 06:37:33 PDT 2026


================
@@ -724,6 +724,15 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Linear &x) {
   auto &objects{std::get<parser::OmpObjectList>(x.v.t)};
   CheckVarIsNotPartOfAnotherVar(GetContext().clauseSource, objects, "LINEAR");
   CheckCrayPointee(objects, "LINEAR", false);
+  for (const auto &ompObject : objects.v) {
----------------
kparzysz wrote:

Could you add this check to `CheckArgumentObjectKind` instead?  We already check similar special conditions for individual clauses (for example "AssumedSizeArrayAllowed").  For this you could add "CommonBlockAllowed" that would be true by default, and set it to false for LINEAR and DEPEND.  Then add a check for it in the loop there.

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


More information about the flang-commits mailing list