[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) {
+    if (const auto *name{std::get_if<parser::Name>(&ompObject.u)}) {
+      if (name->symbol && name->symbol->has<CommonBlockDetails>()) {
----------------
kparzysz wrote:

We have `bool IsCommonBlock(const Symbol &)` that simplifies the check.

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


More information about the flang-commits mailing list