// { dg-do compile } int x; template struct Tt { X arr[20]; }; template struct St { X *tvec; }; template void foo() { struct St > *s; // You can't use an array section like this. Make sure sensible errors are // reported. #pragma omp target map(s->tvec[3:5].arr[0:20]) // { dg-error {request for member 'arr' in 's->St >::tvec\[3:5\]', which is of non-class type 'Tt \[8\]'} "" { target *-*-* } .-1 } { } #pragma omp target map(s->tvec[5:x].arr[0:20]) // { dg-error {invalid use of array with unspecified bounds} "" { target *-*-* } .-1 } { } } struct T { int arr[20]; }; struct S { struct T *tvec; }; int main() { struct S *s; // You can't use an array section like this. Make sure sensible errors are // reported. #pragma omp target map(s->tvec[3:5].arr[0:20]) // { dg-error {request for member 'arr' in 's->S::tvec\[3:5\]', which is of non-class type 'T \[8\]'} "" { target *-*-* } .-1 } { } #pragma omp target map(s->tvec[5:x].arr[0:20]) // { dg-error {invalid use of array with unspecified bounds} "" { target *-*-* } .-1 } // { dg-error {expected '\)' before 'arr'} "" { target *-*-* } .-2 } { } foo (); return 0; }