summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-19 10:18:29 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-19 10:18:29 +0000
commit93bb78b6f8a94ce0f18dbb5d7adf7b38532b334b (patch)
treef5f6359a8ad0fd37c584c6e4a04552ab5d730271
parent927fed673cd9d27db9f46cde6d485e862113f8bd (diff)
downloadgcc-93bb78b6f8a94ce0f18dbb5d7adf7b38532b334b.tar.gz
PR c++/35028
* cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors. * g++.dg/gomp/pr35028.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132426 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/cp-gimplify.c5
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr35028.C19
4 files changed, 28 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 386ff722c53..6f016fcfce5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2008-02-19 Jakub Jelinek <jakub@redhat.com>
+ PR c++/35028
+ * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
+
PR c++/34964
PR c++/35244
* semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 50b40484413..498ecc5379a 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -844,7 +844,8 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
if (arg2)
argarray[i++] = p2;
/* Handle default arguments. */
- for (parm = defparm; parm != void_list_node; parm = TREE_CHAIN (parm), i++)
+ for (parm = defparm; parm && parm != void_list_node;
+ parm = TREE_CHAIN (parm), i++)
argarray[i] = convert_default_arg (TREE_VALUE (parm),
TREE_PURPOSE (parm), fn, i);
t = build_call_a (fn, i, argarray);
@@ -875,7 +876,7 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
if (arg2)
argarray[i++] = build_fold_addr_expr (arg2);
/* Handle default arguments. */
- for (parm = defparm; parm != void_list_node;
+ for (parm = defparm; parm && parm != void_list_node;
parm = TREE_CHAIN (parm), i++)
argarray[i] = convert_default_arg (TREE_VALUE (parm),
TREE_PURPOSE (parm),
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b5ab00f0b67..5e2d40c1d69 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2008-02-19 Jakub Jelinek <jakub@redhat.com>
+ PR c++/35028
+ * g++.dg/gomp/pr35028.C: New test.
+
PR c++/34964
PR c++/35244
* gcc.dg/gomp/pr34964.c: New test.
diff --git a/gcc/testsuite/g++.dg/gomp/pr35028.C b/gcc/testsuite/g++.dg/gomp/pr35028.C
new file mode 100644
index 00000000000..ef7ba07de17
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr35028.C
@@ -0,0 +1,19 @@
+// PR c++/35028
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+struct A
+{
+ A ();
+ A (const A &, ...);
+ ~A ();
+ A operator++ (int);
+};
+
+void
+foo ()
+{
+ A a;
+ #pragma omp parallel firstprivate (a)
+ a++;
+}