[clang] [llvm] Trying to fix undefined symbol error caused by iterator variable (PR #141507)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 5 10:39:34 PDT 2025


ShashwathiNavada wrote:

> Independent of your patch, the following seems to crash. Is it supposed to be valid? Is there an open bug?
> 
> ```
> typedef struct myvec {
>     int a;
>     double *b;
> } myvec_t;
> void foo() {
> #pragma omp declare mapper(id: myvec_t v) map(iterator(it=0:v.a), tofrom: v.b[it])
>   myvec_t s;
>   #pragma omp target map(mapper(id), to:s)
>   {
>   }
> }
> ```
I think the issue here is the missing memory allocation for _s_ in the testcase. So if we allocate memory for _s.b_ the program works fine.

https://github.com/llvm/llvm-project/pull/141507


More information about the llvm-commits mailing list