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

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 12:56:35 PDT 2025


https://github.com/efriedma-quic commented:

The reason I'm suspicious of the getDeclareMapperVarRef check is that SemaOpenMP::ActOnOMPIteratorExpr creates the variable (VarDecl::Create) regardless.  So what's supposed to happen for variables where getDeclareMapperVarRef is false?

--------

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)
  {
  }
}
```

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


More information about the llvm-commits mailing list