[flang-commits] [flang] [flang][OpenMP] Fix crash when arrays used in LINEAR clause (PR #175383)

Krish Gupta via flang-commits flang-commits at lists.llvm.org
Mon Jan 12 11:51:13 PST 2026


================
@@ -808,6 +808,15 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Linear &x) {
 
   // OpenMP 5.2: Linear clause Restrictions
   for (auto &[symbol, source] : symbols) {
+    // Check that the list item is a scalar variable (rank 0)
+    // For declare simd with REF modifier, arrays are allowed
+    bool isArrayAllowed = dir == llvm::omp::Directive::OMPD_declare_simd &&
+        linearMod && linearMod->v == parser::OmpLinearModifier::Value::Ref;
----------------
KrxGu wrote:

Agree.

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


More information about the flang-commits mailing list