================
@@ -20679,6 +20687,19 @@ static bool actOnOMPReductionKindClause(
       Type = Context.getBaseElementType(D->getType().getNonReferenceType());
     }
     auto *VD = dyn_cast<VarDecl>(D);
+    auto *BD = dyn_cast<BindingDecl>(D);
+
+    // Check for unsupported reduction forms on structured bindings.
+    if (BD && (D->getType().getNonReferenceType()->isArrayType() ||
+               BOK == BO_Comma)) {
+      // Array-type reductions are not supported.
+      if (D->getType().getNonReferenceType()->isArrayType())
+        S.Diag(ELoc, diag::err_omp_array_reduction_on_binding);
+      else
+        // User-defined reductions (declare reduction) are not supported.
+        S.Diag(ELoc, diag::err_omp_udr_reduction_on_binding);
+      continue;
----------------
alexey-bataev wrote:

```suggestion
    if (BD && D->getType().getNonReferenceType()->isArrayType()) {
      // Array-type reductions are not supported.
      S.Diag(ELoc, diag::err_omp_array_reduction_on_binding);
      continue;
    }
    if (BD && BOK == BO_Comma) {
      // User-defined reductions (declare reduction) are not supported.
      S.Diag(ELoc, diag::err_omp_udr_reduction_on_binding);
      continue;
    }
```

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

Reply via email to