cchen marked an inline comment as done. cchen added inline comments.
================ Comment at: clang/lib/Sema/SemaOpenMP.cpp:15356 + Expr::EvalResult Result; + if (AE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext())) { + if (!Result.Val.getInt().isNullValue()) { ---------------- ABataev wrote: > Need to check that `AE->getIdx()` is not value dependent, otherwise it may > crash It seems Clang would catch the error before we do the analysis: ``` orig.cpp:6:24: error: array subscript is not an integer #pragma omp target map(a[b]) ^ ~ orig.cpp:15:3: note: in instantiation of function template specialization 'gg<int, double>' requested here gg<int, double>(a, c); ^ orig.cpp:8:5: error: array subscript is not an integer a[b] = 10; ^ ~ 2 errors generated. ``` Also, if we still need it, do we also check type dependent? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74970/new/ https://reviews.llvm.org/D74970 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits