[flang-commits] [flang] [Flang][OpenMP] Fix false positive common block error in LINEAR clause (PR #189170)

via flang-commits flang-commits at lists.llvm.org
Sat Mar 28 21:08:32 PDT 2026


================
@@ -750,7 +750,7 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Linear &x) {
           "The list item `%s` in a LINEAR clause must not be Cray Pointer or a variable with POINTER attribute"_err_en_US,
           symbol->name());
     }
-    if (FindCommonBlockContaining(*symbol)) {
+    if (symbol->has<CommonBlockDetails>()) {
       context_.Say(source,
           "'%s' is a common block name and must not appear in an LINEAR clause"_err_en_US,
----------------
NimishMishra wrote:

```suggestion
          "'%s' is a common block name and must not appear in a LINEAR clause"_err_en_US,
```

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


More information about the flang-commits mailing list