@@ -1318,23 +1318,21 @@ gfc_match_omp_clauses (gfc_omp_clauses *
else if (gfc_match_omp_variable_list (" val (",
&c->lists[OMP_LIST_LINEAR],
false, NULL, &head)
- == MATCH_YES)
+ == MATCH_YES)
linear_op = OMP_LINEAR_VAL;
else if (gfc_match_omp_variable_list (" uval (",
&c->lists[OMP_LIST_LINEAR],
false, NULL, &head)
- == MATCH_YES)
+ == MATCH_YES)
linear_op = OMP_LINEAR_UVAL;
else if (gfc_match_omp_variable_list ("",
&c->lists[OMP_LIST_LINEAR],
false, &end_colon, &head)
- == MATCH_YES)
+ == MATCH_YES)
linear_op = OMP_LINEAR_DEFAULT;
else
{
- gfc_free_omp_namelist (*head);
gfc_current_locus = old_loc;
- *head = NULL;
break;
}
if (linear_op != OMP_LINEAR_DEFAULT)
@@ -0,0 +1,12 @@
+! PR fortran/84116
+! { dg-do compile }
+
+program pr84116
+ integer :: i, j
+ !$omp simd linear ((i)) ! { dg-error "Syntax error" }
+ do i = 1, 2
+ end do
+ !$omp simd linear () ! { dg-error "Syntax error" }
+ do j = 1, 2
+ end do
+end