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 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
