https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120682
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The reason why it is invalid is that T lookup fails in the declare mapper definition. You can't take the T literally from the OpenMP standard, that is a a non-literal for any type of certain properties. Say #pragma omp declare mapper(myvec<double> v) map(v, v.data[0:v.len]) instead of your line would be valid ans is accepted. https://godbolt.org/z/7oTjh3Ka3 declare mapper can appear say in template function body and there you can of course use template parameters even in the declare mapper clauses.