-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[analyzer] Add documentation for std::variant checker #76501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang-static-analyzer-1 @llvm/pr-subscribers-clang Author: Gábor Spaits (spaits) ChangesAdd a short documentation for Full diff: https://github.com/llvm/llvm-project/pull/76501.diff 1 Files Affected:
diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst
index 81d40395067c9a..1e5ba013f85d67 100644
--- a/clang/docs/analyzer/checkers.rst
+++ b/clang/docs/analyzer/checkers.rst
@@ -2097,6 +2097,18 @@ This checker is a part of ``core.StackAddressEscape``, but is temporarily disabl
.. _alpha-core-TestAfterDivZero:
+alpha.core.StdVariant (C++)
+"""""""""""""""""""""""
+Check if the active value accessed in an ``std::variant`` instance.
+.. code-block:: cpp
+
+ void test() {
+ std::variant <int, char> v = 25;
+ char c = stg::get<char>(v); // warn
+ }
+
+.. _alpha-core-StdVariant:
+
alpha.core.TestAfterDivZero (C)
"""""""""""""""""""""""""""""""
Check for division by variable that is later compared against 0.
|
f7f26c3
to
e885006
Compare
Note: the docs build check failed with
|
67e6479
to
c1884cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a trivial typo, otherwise LGTM.
Thanks for the update!
Added some more explanation. I will continue using "Check if" since the other descriptions that I saw stared like that (or "Check for"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the release notes with a link as documentation. Follow the existing patterns there.
That's a good point for using "Check if". |
e0dabac
to
daec813
Compare
daec813
to
b271420
Compare
Co-authored-by: Balazs Benics <[email protected]>
Co-authored-by: Balazs Benics <[email protected]>
Co-authored-by: whisperity <[email protected]>
Co-authored-by: DonatNagyE <[email protected]>
let me check it again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now. Thanks.
I will merge the PR when the CI builds have finished. Thank you for reviewing. |
Add a short documentation for
StdVariantChecker
.