ABataev added inline comments.
================ Comment at: clang/lib/Sema/SemaOpenMP.cpp:19481-19482 if (VD && DSAS->isThreadPrivate(VD)) { + if (NoDiagnose) + continue; DSAStackTy::DSAVarData DVar = DSAS->getTopDSA(VD, /*FromParent=*/false); ---------------- jyu2 wrote: > ABataev wrote: > > jyu2 wrote: > > > ABataev wrote: > > > > Hmm, should not we still diagnose this case? > > > The rule is skip the error as well as skip adding implicit map clause. > > > So that we don't get regression for old code. > > I think we already have the check for it for the reduction clause, so I > > think we can skip this check here. > In general yes. But not for some special case, please look > clang/test/OpenMP/reduction_implicit_map.cpp, in the first test, if I remove > this change the error will be emit. In CUDA device code, the local variable > is implicitly threat as thridprivate. > > > #if defined(CUDA) > // expected-no-diagnostics > > int foo(int n) { > double *e; > //no error and no implicit map generated for e[:1] > #pragma omp target parallel reduction(+: e[:1]) > *e=10; > ; > return 0; > } I just was not quite clear, I agree with your previous answer ;) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108132/new/ https://reviews.llvm.org/D108132 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits