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

Niels Dekker via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 12 05:23:55 PDT 2026


================
@@ -203,14 +203,19 @@ infrastructure are described first, followed by tool-specific sections.
   the pointer points to an incomplete (forward-declared) type.
 
 - Improved {doc}`bugprone-redundant-branch-condition
-  <clang-tidy/checks/bugprone/redundant-branch-condition>` check by fixing
-  false positives when the condition variable is changed later in a loop that
-  encloses the inner `if`.
+  <clang-tidy/checks/bugprone/redundant-branch-condition>` check:
+  
+    - Fixed false positives when the condition variable is changed later in a loop that
+      encloses the inner `if`.
+
+    - Fixed false negatives when there are two declaration statement in both side of `&&` in
+      `if`.it showing correct warning for first declaration and failed for second declaration in if
+      condition.eg.  `(x && y) { if (y) ... }`. 
----------------
N-Dekker wrote:

Sorry, I still don't understand it. Where are the declarations in `if (x && y) { if (y) ... }`? I don't think "there are two declaration statement". Can anyone else here describe this case more formally? Otherwise I would suggest to just keep it informal. For example:

 - Fixed false negatives on cases like `if (x && y) { if (y) ... }`

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


More information about the cfe-commits mailing list