aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-09-10 09:30:29 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2015-09-10 09:30:29 +0200
commit4e4d2c41b9921ee5b8aa8e9d5874da8786e45559 (patch)
tree9f7f0971620fe2800517b8675038829c87bade3d /gcc
parenta8a098acfcfc0b59ddbbec9075ffb195c3e63b3e (diff)
downloadgcc-4e4d2c41b9921ee5b8aa8e9d5874da8786e45559.zip
gcc-4e4d2c41b9921ee5b8aa8e9d5874da8786e45559.tar.gz
gcc-4e4d2c41b9921ee5b8aa8e9d5874da8786e45559.tar.bz2
re PR c++/67511 (ICE with invalid OpenMP random access iterator)
PR c++/67511 * semantics.c (handle_omp_for_class_iterator): Don't wrap error_mark_node into a NOP_EXPR to void_type_node. * g++.dg/gomp/pr67511.C: New test. From-SVN: r227606
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c3
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr67511.C20
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1cc576a..4b32f5a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/67511
+ * semantics.c (handle_omp_for_class_iterator): Don't wrap
+ error_mark_node into a NOP_EXPR to void_type_node.
+
2015-09-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53184
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 2a69ab0..5c3f1be 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -6453,7 +6453,8 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv,
iter_init = build_x_modify_expr (elocus,
iter, PLUS_EXPR, iter_init,
tf_warning_or_error);
- iter_init = build1 (NOP_EXPR, void_type_node, iter_init);
+ if (iter_init != error_mark_node)
+ iter_init = build1 (NOP_EXPR, void_type_node, iter_init);
finish_expr_stmt (iter_init);
finish_expr_stmt (build_x_modify_expr (elocus,
last, NOP_EXPR, decl,
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 140766d..fba8b15 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2015-09-10 Jakub Jelinek <jakub@redhat.com>
+ PR c++/67511
+ * g++.dg/gomp/pr67511.C: New test.
+
PR c/67502
* c-c++-common/gomp/pr67502.c: New test.
diff --git a/gcc/testsuite/g++.dg/gomp/pr67511.C b/gcc/testsuite/g++.dg/gomp/pr67511.C
new file mode 100644
index 0000000..3e0e9a3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr67511.C
@@ -0,0 +1,20 @@
+// PR c++/67511
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+struct I
+{
+ I ();
+ I (const I &);
+ I &operator++ ();
+ bool operator< (const I &) const;
+};
+__PTRDIFF_TYPE__ operator- (const I &, const I &);
+
+void
+foo (I &x, I &y)
+{
+#pragma omp for
+ for (I i = x; i < y; ++i) // { dg-error "no match for" }
+ ;
+}