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

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Tue Mar 31 03:18:41 PDT 2026


================
@@ -750,9 +750,9 @@ 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>()) {
----------------
eugeneepshteyn wrote:

Note: `OmpStructureChecker::CheckMultListItems()` has the same pattern: 
```
          if (FindCommonBlockContaining(*(name->symbol))) {
            context_.Say(clause->source,
                "'%s' is a common block name and can not appear in an "
                "ALIGNED clause"_err_en_US,
                name->ToString());
```
Maybe the same issue also affects ALIGNED clause? If it's indeed a problem, maybe you could also fix that issue as part of this PR.

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


More information about the flang-commits mailing list