[clang-tools-extra] 89655bd - [NFC] [clang-tidy] Add doc about FP in unchecked-statusor-access (#179592)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 4 12:48:30 PST 2026
Author: Florian Mayer
Date: 2026-02-04T12:48:24-08:00
New Revision: 89655bda0daf3bc13c74b3020fbc463b8e4506d4
URL: https://github.com/llvm/llvm-project/commit/89655bda0daf3bc13c74b3020fbc463b8e4506d4
DIFF: https://github.com/llvm/llvm-project/commit/89655bda0daf3bc13c74b3020fbc463b8e4506d4.diff
LOG: [NFC] [clang-tidy] Add doc about FP in unchecked-statusor-access (#179592)
Added:
Modified:
clang-tools-extra/docs/clang-tidy/checks/abseil/unchecked-statusor-access.rst
Removed:
################################################################################
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..7aef674724b08 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,21 @@ accessed:
}
}
}
+
+Reasoning about integers
+------------------------
+
+Because it uses a simple SAT solver, the check cannot reason about integer
+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 conditions are identical.
More information about the cfe-commits
mailing list