[PATCH] D150394: [OpenMP 5.2] Deprecate MINUS (-) operator on reduction clauses

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 15 06:56:07 PDT 2023


ABataev added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10487-10488
   "a reduction list item with incomplete type %0">;
+def err_omp_reduction_minus_type : Error<
+  "a reduction list item with minus(-) operator is not supported">;
+def warn_omp_minus_in_reduction_deprecated : Warning<
----------------
We already have message for unsupported reduction identifier. Better to modify switch in static bool actOnOMPReductionKindClause function and check if OpenMP > 52, set BOK to BO_Comma, if incoming OOK is OO_Minus. In this case it will be automatically diagnosed for OpenMP>52 as not allowed reduction identifier.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10490
+def warn_omp_minus_in_reduction_deprecated : Warning<
+  "minus(-) operator for reductions is deprecated; use an user defined reduction instead">,
+  InGroup<Deprecated>;
----------------
`use + or user defined reudction instead`? And better make it a fixme note.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150394



More information about the cfe-commits mailing list