1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
// { dg-do compile }
// { dg-options "-fopenmp" }
struct S
{
void bar (int);
};
void
S::bar (int x)
{
#pragma omp target map (this, x) // { dg-error "cannot take the address of .this., which is an rvalue expression" }
;
#pragma omp target map (this[0], x)
;
#pragma omp target update to (this, x) // { dg-error "cannot take the address of .this., which is an rvalue expression" }
#pragma omp target update to (this[0], x)
#pragma omp target update from (this, x) // { dg-error "cannot take the address of .this., which is an rvalue expression" }
#pragma omp target update from (this[1], x)
}
template <int N>
struct T
{
void bar (int);
};
template <int N>
void
T<N>::bar (int x)
{
#pragma omp target map (this, x) // { dg-error "cannot take the address of .this., which is an rvalue expression" }
;
#pragma omp target map (this[0], x)
;
#pragma omp target update to (this, x) // { dg-error "cannot take the address of .this., which is an rvalue expression" }
#pragma omp target update to (this[0], x)
#pragma omp target update from (this, x) // { dg-error "cannot take the address of .this., which is an rvalue expression" }
#pragma omp target update from (this[1], x)
}
template struct T<0>;
|