[llvm-branch-commits] [NFC] [clang-tidy] Add doc about FP in unchecked-statusor-access (PR #179592)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 3 18:05:25 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tidy

Author: Florian Mayer (fmayer)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) clang-tools-extra/docs/clang-tidy/checks/abseil/unchecked-statusor-access.rst (+17) 


``````````diff
diff --git a/clang-tools-extra/docs/clang-tidy/checks/abseil/unchecked-statusor-access.rst b/clang-tools-extra/docs/clang-tidy/checks/abseil/unchecked-statusor-access.rst
index 325f5697481b6..0055b19036a5b 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/abseil/unchecked-statusor-access.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/abseil/unchecked-statusor-access.rst
@@ -382,3 +382,20 @@ accessed:
        }
      }
    }
+
+Reasoning about integers
+------------------------
+
+Because it uses a simple SAT solver, the checker cannot reason about integers
+inequalities. For instance, the following will result in a false positive:
+
+.. code:: cpp
+   void f(int n, absl::StatusOr<int> x) {
+      if (n > 0)
+        CHECK_OK(x);
+      if (n > 1)
+        return *x;  // false positive
+      return 0;
+   }
+
+In fact, currently this is also the case if the two conditinos are identical.

``````````

</details>


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


More information about the llvm-branch-commits mailing list