+2011-04-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/48632
+ * parser.c (cp_parser_omp_for_loop): Don't use cp_parser_omp_for_incr
+ for type dependent pointers.
+
2011-04-18 Jim Meyering <meyering@redhat.com>
* pt.c (type_unification_real): Fix typo in comment: s/in in/in/.
/* If decl is an iterator, preserve the operator on decl
until finish_omp_for. */
if (decl
- && (type_dependent_expression_p (decl)
+ && ((type_dependent_expression_p (decl)
+ && !POINTER_TYPE_P (TREE_TYPE (decl)))
|| CLASS_TYPE_P (TREE_TYPE (decl))))
incr = cp_parser_omp_for_incr (parser, decl);
else
+2011-04-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/48632
+ * g++.dg/gomp/pr48632.C: New test.
+
2011-04-18 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/sse2-maskmovdqu.c: New test.
--- /dev/null
+// PR c++/48632
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+template<typename T>
+void
+foo (T *x, T *y, unsigned z)
+{
+#pragma omp parallel for
+ for (T *p = x; p < y; p += z)
+ ;
+#pragma omp parallel for
+ for (T *p = y; p > x; p -= z)
+ ;
+}
+
+int
+main ()
+{
+ char buf[10];
+ foo (&buf[0], &buf[9], 1);
+}