Map(to) vs map(tofrom) for parameter pack in OpenMP target region

Dear experts,

is there a way to specify that a parameter pack should be mapped as to, instead of the implicit tofrom in a target region? Please see a dummy example below:

void bar(int& value, int context) {
    value += context;
}
void bar(int& value, int context_1, int context_2) {
    value += context_1 + context_2;
}
template <typename... T>
void foo(int size, int* array, const T... context) {
#pragma omp target teams distribute parallel for \
    map(tofrom:array[0:size]) \ 
    map(to:context)
    for (int i = 0; i < size; i++) {
        bar(array[i], context...);
    }
}

...

foo<int>(size, arr, 6);

From libomptarget debug (llvm@16):

Libomptarget device 0 info: firstprivate(size)[4] (implicit)
Libomptarget device 0 info: tofrom(array[0:size])[40] 
Libomptarget device 0 info: tofrom(context)[8] (implicit)
Libomptarget device 0 info: firstprivate(context)[4] (implicit)

Thank you,
Georgiana

It seems to me that you already know the answer to the question you asked: “Is there a way to specify that a parameter pack should be mapped as to , instead of the implicit tofrom in a target region?”, and you are using that method (by specifying map(to:context)).
So, I think your real question is “Is this a bug?”, and my answer to that is, “Yes, probably, please report it.”

I will double-check with latest LLVM build and if I see the same problem, I will report it. Thank you.