================ @@ -423,6 +450,52 @@ ExprResult SemaOpenACC::ActOnIntExpr(OpenACCDirectiveKind DK, return IntExpr; } +ExprResult SemaOpenACC::ActOnVar(Expr *VarExpr) { + // We still need to retain the array subscript/subarray exprs, so work on a + // copy. + Expr *CurVarExpr = VarExpr->IgnoreParenImpCasts(); + + // Sub-arrays/subscript-exprs are fine as long as the base is a + // VarExpr/MemberExpr. So strip all of those off. + while (isa<ArraySectionExpr, ArraySubscriptExpr>(CurVarExpr)) { + if (auto *SubScrpt = dyn_cast<ArraySubscriptExpr>(CurVarExpr)) + CurVarExpr = SubScrpt->getBase()->IgnoreParenImpCasts(); + else + CurVarExpr = + cast<ArraySectionExpr>(CurVarExpr)->getBase()->IgnoreParenImpCasts(); + } ---------------- alexey-bataev wrote:
What if the array is casted to a pointer, will this be supported? https://github.com/llvm/llvm-project/pull/90521 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits