[llvm] [NFC][IR] Fix MSVC C4706 diagnostic w/ 741b2cda32e1 (PR #182682)

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 21 07:04:19 PST 2026


https://github.com/jsji created https://github.com/llvm/llvm-project/pull/182682

Fix error:

llvm\include\llvm\IR\Operator.h(279) : error C2220: the following warning is treated as an error
llvm\include\llvm\IR\Operator.h(279) : warning C4706: assignment within conditional expression


>From 5e6b88aeacc747e109dc8f028bbb4f95f6eedcaf Mon Sep 17 00:00:00 2001
From: Jinsong Ji <jinsong.ji at intel.com>
Date: Sat, 21 Feb 2026 06:53:48 -0800
Subject: [PATCH] [NFC][IR] Fix MSVC C4706 diagnostic w/ 741b2cda32e1

Fix error:

llvm\include\llvm\IR\Operator.h(279) : error C2220: the following warning is treated as an error
llvm\include\llvm\IR\Operator.h(279) : warning C4706: assignment within conditional expression
---
 llvm/include/llvm/IR/Operator.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/IR/Operator.h b/llvm/include/llvm/IR/Operator.h
index 10816c0e62c29..2e0e71cbbf315 100644
--- a/llvm/include/llvm/IR/Operator.h
+++ b/llvm/include/llvm/IR/Operator.h
@@ -276,7 +276,7 @@ class FPMathOperator : public Operator {
     } else if (auto *ArrayTy = dyn_cast<ArrayType>(Ty)) {
       do {
         Ty = ArrayTy->getElementType();
-      } while ((ArrayTy = dyn_cast<ArrayType>(Ty)));
+      } while ((ArrayTy = dyn_cast<ArrayType>(Ty)) != nullptr);
     }
     return Ty->isFPOrFPVectorTy();
   };



More information about the llvm-commits mailing list