gcc/testsuite/g++.dg/goacc/pr118590.C
raw| 1 | // PR c++/118590 |
| 2 | // { dg-do compile } |
| 3 | |
| 4 | template <typename T> |
| 5 | struct A |
| 6 | { |
| 7 | int z; |
| 8 | }; |
| 9 | |
| 10 | template <typename T, typename U> |
| 11 | struct B |
| 12 | { |
| 13 | char *w; |
| 14 | A<T> y; |
| 15 | }; |
| 16 | |
| 17 | template <typename T, typename U> |
| 18 | void |
| 19 | foo (B<T, U> &x) |
| 20 | { |
| 21 | A<T> c = x.y; |
| 22 | #pragma acc enter data copyin(x.w[0 : c.z]) |
| 23 | } |
| 24 | |
| 25 | void |
| 26 | bar (B<int, int> &x) |
| 27 | { |
| 28 | foo (x); |
| 29 | } |