diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-05-19 09:44:31 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-05-19 09:44:31 +0200 |
commit | 4577f7309a8b7c410e1ebe350250398997f0a8df (patch) | |
tree | 6ab10bfd313ec6b9af503559d01810292772524a /libgomp | |
parent | d1e5eb3ef68e87807a6046d8746cf262d42c7394 (diff) | |
download | gcc-4577f7309a8b7c410e1ebe350250398997f0a8df.zip gcc-4577f7309a8b7c410e1ebe350250398997f0a8df.tar.gz gcc-4577f7309a8b7c410e1ebe350250398997f0a8df.tar.bz2 |
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
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c++/pr48869.C | 68 |
2 files changed, 73 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 416ddc4..9738289 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2011-05-19 Jakub Jelinek <jakub@redhat.com> + + PR c++/48869 + * testsuite/libgomp.c++/pr48869.C: New test. + 2011-05-06 Jakub Jelinek <jakub@redhat.com> PR fortran/48894 diff --git a/libgomp/testsuite/libgomp.c++/pr48869.C b/libgomp/testsuite/libgomp.c++/pr48869.C new file mode 100644 index 0000000..ec952d9 --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/pr48869.C @@ -0,0 +1,68 @@ +// 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; +} |