aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-11-07 21:51:05 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-11-07 21:51:05 +0100
commit4dbeb716123290202774ec5127462946bdfacbd1 (patch)
tree58f678236f303012b63383c3d2287adcd26473e0 /libgomp
parentacd377795f259233d3b9c5cd81a9156c1c3081f9 (diff)
downloadgcc-4dbeb716123290202774ec5127462946bdfacbd1.zip
gcc-4dbeb716123290202774ec5127462946bdfacbd1.tar.gz
gcc-4dbeb716123290202774ec5127462946bdfacbd1.tar.bz2
re PR c++/82835 (ICE on valid code with -fopenmp)
PR c++/82835 * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to convert_default_arg instead of i. * testsuite/libgomp.c++/pr82835.C: New test. From-SVN: r254511
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr82835.C34
2 files changed, 39 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 7c0e808..19966bd 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/82835
+ * testsuite/libgomp.c++/pr82835.C: New test.
+
2017-11-06 Martin Liska <mliska@suse.cz>
* testsuite/libgomp.c++/loop-2.C: Return a value
diff --git a/libgomp/testsuite/libgomp.c++/pr82835.C b/libgomp/testsuite/libgomp.c++/pr82835.C
new file mode 100644
index 0000000..df64ecf
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr82835.C
@@ -0,0 +1,34 @@
+// PR c++/82835
+// { dg-do run }
+
+int a, b;
+
+template <class>
+struct C {
+ C (int x = a) : c (5) { if (x != 137) __builtin_abort (); }
+ int c;
+};
+
+struct D {
+ void foo ();
+ int d;
+};
+
+void
+D::foo ()
+{
+ C<int> c;
+#pragma omp for private (c)
+ for (b = 0; b < d; b++)
+ c.c++;
+}
+
+int
+main ()
+{
+ a = 137;
+ D d;
+ d.d = 16;
+ d.foo ();
+ return 0;
+}