================
@@ -1903,6 +1912,15 @@ bool SemaOpenACC::CheckReductionVarType(Expr *VarExpr) {
PartialDiagnostic PD = PDiag(diag::note_acc_reduction_array)
<< diag::OACCReductionArray::ArrayTy << CurType;
Notes.push_back({VarLoc, PD});
+
+ if (!AT->isConstantArrayType()) {
+ // Non-constant length arrays cannot be used in a reduction clause.
+ // To fix llvm/llvm-project#199162
+ return EmitDiags(VarLoc, PDiag(diag::err_acc_reduction_type)
+ << CurType->getAsRecordDecl()
----------------
erichkeane wrote:
This is absolutely wrong... why are you trying to get something you know is a
array type as a record decl?
https://github.com/llvm/llvm-project/pull/199178
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits