[clang-tools-extra] [clang-tidy] Fix false negative for binary logical expressions for tw… (PR #230846)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 21 08:12:28 PDT 2026


================
@@ -278,6 +278,19 @@ void positive_direct_outer_and_rhs() {
     // CHECK-FIXES: {{^\ *$}}
   }
 }
+void positive_direct_outer_and_rhs_bool() {
+  bool onFire = isBurning();
+  bool isComing = isFireFighterComing();
+  if (isComing && onFire) {
+    if (onFire) {
+      // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant condition 'onFire' [bugprone-redundant-branch-condition]
+      // CHECK-FIXES: {{^\ *$}}
+      scream();
+    }
+    // CHECK-FIXES: {{^\ *$}}
+  }
+}
+
----------------
EugeneZelenko wrote:

```suggestion
```

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


More information about the cfe-commits mailing list