[PATCH] D78643: [OpenMP] Fix false error report of array subscription for templated indexes.

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 22 11:26:14 PDT 2020


ABataev added a comment.

In D78643#1997344 <https://reviews.llvm.org/D78643#1997344>, @jdoerfert wrote:

> This looks reasonable to me. @ABataev WDYT?


I would add a positive test with -ast-print



================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15913
+        if (auto *ASE = dyn_cast<ArraySubscriptExpr>(SimpleExpr)) {
+          QualType BaseType = ASE->getBase()->getType();
+          if (!BaseType->isDependentType() &&
----------------
Just `QualType BaseType = ASE->getBase()->getType().getNonReferenceType();` and drop the call for `getNonReferenceType()` in later checks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78643/new/

https://reviews.llvm.org/D78643





More information about the cfe-commits mailing list