* parser.c (cp_parser_omp_for_loop): Disallow ordered clause with
argument for range-for loops.
* g++.dg/gomp/doacross-1.C: New test.
From-SVN: r265307
+2018-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ * parser.c (cp_parser_omp_for_loop): Disallow ordered clause with
+ argument for range-for loops.
+
2018-10-18 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_taskloop): Add forward declaration.
pre_body = this_pre_body;
}
+ if (ordered_cl)
+ error_at (OMP_CLAUSE_LOCATION (ordered_cl),
+ "%<ordered%> clause with parameter on "
+ "range-based %<for%> loop");
+
goto parse_close_paren;
}
}
+2018-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/gomp/doacross-1.C: New test.
+
2018-10-18 Jakub Jelinek <jakub@redhat.com>
* c-c++-common/gomp/clauses-1.c (foo): Add ntm argument and
--- /dev/null
+// { dg-do compile { target c++11 } }
+// { dg-options "-fopenmp" }
+
+int a[42];
+
+void
+foo ()
+{
+ #pragma omp for ordered (1) // { dg-error "'ordered' clause with parameter on range-based 'for' loop" }
+ for (auto x : a)
+ ;
+}
+
+void
+bar ()
+{
+ #pragma omp for ordered (2) // { dg-error "'ordered' clause with parameter on range-based 'for' loop" }
+ for (int i = 0; i < 1; i++)
+ for (auto x : a)
+ ;
+}