[flang-commits] [flang] Fix compilation warning (PR #99328)

via flang-commits flang-commits at lists.llvm.org
Wed Jul 17 06:46:22 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

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

Author: Pete Steinfeld (psteinfeld)

<details>
<summary>Changes</summary>

With change #<!-- -->98881, I was getting a warning that an expression needed more parentheses.

Note that I build with GCC 9.3.0.

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


1 Files Affected:

- (modified) flang/lib/Optimizer/Builder/IntrinsicCall.cpp (+1-1) 


``````````diff
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index e12e21bb00e15..ba71fb3b4040c 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -6148,7 +6148,7 @@ IntrinsicLibrary::genScan(mlir::Type resultType,
 fir::ExtendedValue
 IntrinsicLibrary::genSecond(std::optional<mlir::Type> resultType,
                             mlir::ArrayRef<fir::ExtendedValue> args) {
-  assert(args.size() == 1 && !resultType || args.empty() && resultType);
+  assert((args.size() == 1 && !resultType) || (args.empty() && resultType));
 
   fir::ExtendedValue result;
 

``````````

</details>


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


More information about the flang-commits mailing list