================
@@ -648,9 +648,15 @@ ExprResult CheckVarType(SemaOpenACC &S, OpenACCClauseKind 
CK, Expr *VarExpr,
     InnerTy = RefTy->getPointeeType();
 
   if (auto *ArrTy = InnerTy->getAsArrayTypeUnsafe()) {
-    // Non constant arrays decay to 'pointer', so warn and return that we're
-    // successful.
     if (!ArrTy->isConstantArrayType()) {
+      // Variable length arrays cannot be used in a reduction clause.
+      // To fix llvm/llvm-project#199162
+      if (CK == OpenACCClauseKind::Reduction) {
+        S.Diag(InnerLoc, clang::diag::err_acc_reduction_non_const_array);
----------------
erichkeane wrote:

See the other places we do this, we should probably also emit the reduction 
'note'.

https://github.com/llvm/llvm-project/pull/199178
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to