diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0142-PR-c-48632.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0142-PR-c-48632.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0142-PR-c-48632.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0142-PR-c-48632.patch new file mode 100644 index 0000000000..989a1e6607 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0142-PR-c-48632.patch @@ -0,0 +1,55 @@ +From 71ec07630d08b813b39a65a932c71c78b8ffd845 Mon Sep 17 00:00:00 2001 +From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Mon, 18 Apr 2011 21:56:12 +0000 +Subject: [PATCH 142/200] PR c++/48632 + * parser.c (cp_parser_omp_for_loop): Don't use cp_parser_omp_for_incr + for type dependent pointers. + + * g++.dg/gomp/pr48632.C: New test. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172675 138bc75d-0d04-0410-961f-82ee72b054a4 + +index daba2fc..ba3a98f 100644 +--- a/gcc/cp/parser.c ++++ b/gcc/cp/parser.c +@@ -24632,7 +24632,8 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses) + /* 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 +new file mode 100644 +index 0000000..afa8b18 +--- /dev/null ++++ b/gcc/testsuite/g++.dg/gomp/pr48632.C +@@ -0,0 +1,22 @@ ++// 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); ++} +-- +1.7.0.4 + |