[flang-commits] [flang] [flang][omp] Heed valid build warning (PR #88015)

via flang-commits flang-commits at lists.llvm.org
Mon Apr 8 10:18:04 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-fir-hlfir

Author: Peter Klausler (klausler)

<details>
<summary>Changes</summary>

Address a bug found by a compiler warning, and thereby also fix -Werror builds.

---
Full diff: https://github.com/llvm/llvm-project/pull/88015.diff


1 Files Affected:

- (modified) flang/lib/Lower/OpenMP/ReductionProcessor.h (+2-3) 


``````````diff
diff --git a/flang/lib/Lower/OpenMP/ReductionProcessor.h b/flang/lib/Lower/OpenMP/ReductionProcessor.h
index 7ea252fde3602e..8b116a4c520411 100644
--- a/flang/lib/Lower/OpenMP/ReductionProcessor.h
+++ b/flang/lib/Lower/OpenMP/ReductionProcessor.h
@@ -151,9 +151,8 @@ mlir::Value
 ReductionProcessor::getReductionOperation(fir::FirOpBuilder &builder,
                                           mlir::Type type, mlir::Location loc,
                                           mlir::Value op1, mlir::Value op2) {
-  assert(type.isIntOrIndexOrFloat() ||
-         fir::isa_complex(type) &&
-             "only integer, float and complex types are currently supported");
+  assert((type.isIntOrIndexOrFloat() || fir::isa_complex(type)) &&
+         "only integer, float and complex types are currently supported");
   if (type.isIntOrIndex())
     return builder.create<IntegerOp>(loc, op1, op2);
   if (fir::isa_real(type))

``````````

</details>


https://github.com/llvm/llvm-project/pull/88015


More information about the flang-commits mailing list