diff --git a/flang/lib/Semantics/check-omp-loop.cpp b/flang/lib/Semantics/check-omp-loop.cpp index 951dfe1f3bec..a801d526af0a 100644 --- a/flang/lib/Semantics/check-omp-loop.cpp +++ b/flang/lib/Semantics/check-omp-loop.cpp @@ -764,7 +764,7 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Linear &x) { context_.Say(clauseSource, "A modifier may not be specified in a LINEAR clause on the %s directive"_err_en_US, ContextDirectiveAsFortran()); - return; + // Don't return early - continue to check other restrictions } auto &desc{OmpGetDescriptor()}; diff --git a/flang/test/Semantics/OpenMP/linear-clause01.f90 b/flang/test/Semantics/OpenMP/linear-clause01.f90 index ae4a041c9411..63b09c07875e 100644 --- a/flang/test/Semantics/OpenMP/linear-clause01.f90 +++ b/flang/test/Semantics/OpenMP/linear-clause01.f90 @@ -7,11 +7,9 @@ ! Case 1 subroutine linear_clause_01(arg) integer, intent(in) :: arg(:) -! !ERROR: A modifier may not be specified in a LINEAR clause on the DO directive -! !ERROR: List item 'arg' in LINEAR clause must be a scalar variable -! TODO: the following line currently breaks buildbots. Disabling it until the author -! of the breaking change can fix it. -! !$omp do linear(uval(arg)) + !ERROR: A modifier may not be specified in a LINEAR clause on the DO directive + !ERROR: List item 'arg' in LINEAR clause must be a scalar variable + !$omp do linear(uval(arg)) do i = 1, 5 print *, arg(i) end do