gcc/libgomp/testsuite/libgomp.c++/pr48869.C
Jakub Jelinek 4577f7309a re PR c++/48869 (OpenMP task construct fails to instantiate copy constructor(same as Bug 36523))
PR c++/48869
	* method.c (get_dtor, get_copy_ctor): Add COMPLAIN argument,
	pass it down to locate_fn_flags.
	* cp-tree.h (get_dtor, get_copy_ctor): Adjust prototypes.
	* semantics.c (cxx_omp_create_clause_info): Adjust callers.
	* cp-gimplify.c: Include splay-tree.h.
	(splay_tree_compare_decl_uid, omp_var_to_track,
	omp_cxx_notice_variable): New functions.
	(struct cp_genericize_omp_taskreg): New type.
	(struct cp_genericize_data): Add omp_ctx field.
	(cp_genericize_r): Attempt to determine implicitly determined
	firstprivate class type variables.
	(cp_genericize): Clear omp_ctx.
	* Make-lang.in (cp/cp-gimplify.o): Depend on $(SPLAY_TREE_H).

	* testsuite/libgomp.c++/pr48869.C: New test.

From-SVN: r173888
2011-05-19 09:44:31 +02:00

69 lines
1023 B
C

// PR c++/48869
// { dg-do run }
// { dg-options "-std=gnu++0x" }
template <const int N>
struct A
{
A () {}
A (const A&) = delete;
void foo () {}
~A () {}
};
template <const int N>
struct B
{
B () {}
B (const B&) {}
void foo () {}
~B () {}
};
void __attribute__((used))
foo (B<6> b6)
{
#pragma omp task
b6.foo ();
}
int
main ()
{
A<0> a0;
#pragma omp task shared(a0)
a0.foo ();
#pragma omp task default(shared)
a0.foo ();
#pragma omp parallel shared(a0)
#pragma omp task
a0.foo ();
#pragma omp task
{
A<1> a1;
a1.foo ();
}
B<0> b0;
#pragma omp task shared(b0)
b0.foo ();
B<1> b1;
#pragma omp task default(shared)
b1.foo ();
B<2> b2;
#pragma omp parallel shared(b2)
#pragma omp task
b2.foo ();
B<3> b3;
#pragma omp task
b3.foo ();
B<4> b4;
#pragma omp parallel private (b4)
#pragma omp task
b4.foo ();
B<5> b5;
#pragma omp parallel firstprivate (b5)
#pragma omp task
b5.foo ();
return 0;
}