re PR c++/35028 (ICE with strange ctor and firstprivate)

PR c++/35028
	* cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.

	* g++.dg/gomp/pr35028.C: New test.

From-SVN: r132426
This commit is contained in:
Jakub Jelinek 2008-02-19 11:18:29 +01:00 committed by Jakub Jelinek
parent edb6000e37
commit d2ee546fd6
4 changed files with 28 additions and 2 deletions

View File

@ -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

View File

@ -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),

View File

@ -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.

View File

@ -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++;
}