Krish Gupta 804c0345f5
[flang][OpenMP] Fix LINEAR clause validation to report all errors (#175938)
Fixes #175688 

After #175383 was merged, test failures occurred because removing the
early return exposed additional errors that tests weren't expecting.

This PR comprehensively fixes the issue by:

1. **Removes the early return** in check-omp-loop.cpp (line 767) after
detecting a modifier error on DO/SIMD directives. Previously, when a
modifier error was found, the function would return immediately without
checking other restrictions like the scalar requirement. Now all
applicable errors are reported, improving diagnostics.

2. **Updates linear-clause01.f90** to expect both the modifier error AND
the scalar error for Case 1 and Case 2, where arrays are used
incorrectly in LINEAR clauses.

3. **Updates clause-validity01.f90** to use the new OpenMP 5.2 syntax
(`linear(b: val)` instead of `linear(val(b))`). The old syntax triggers
deprecation warnings, which are now caught because we no longer return
early after the modifier error.

Thanks to @ergawy for identifying the clause-validity01.f90 fix needed.

The changes ensure better error reporting for users - they now see all
issues with their LINEAR clauses instead of just the first error.
2026-01-14 12:02:43 -05:00
..