-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[clang-tidy] Add a release note about unchecked-optional-access smart pointer caching #122290
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
[clang-tidy] Add a release note about unchecked-optional-access smart pointer caching #122290
Conversation
… pointer caching With caching added in llvm#120249, inform in notes that the `IgnoreSmartPointerDereference` option shouldn't be needed anymore. Other caching also added earlier: llvm#112605
@llvm/pr-subscribers-clang-tidy @llvm/pr-subscribers-clang-tools-extra Author: Jan Voung (jvoung) ChangesWith caching added in #120249, the Other caching also added earlier: #112605 Full diff: https://github.com/llvm/llvm-project/pull/122290.diff 1 Files Affected:
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index 94e15639c4a92e..47cc4f6f17fed5 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -232,6 +232,10 @@ Changes in existing checks
<clang-tidy/checks/bugprone/unchecked-optional-access>` to support
`bsl::optional` and `bdlb::NullableValue` from
<https://github.com/bloomberg/bde>_.
+ Fixed false positives from smart pointer accessors repeated in checking
+ ``has_value`` and accessing ``value``, by caching the locations returned
+ by the accessors. The option `IgnoreSmartPointerDereference` should no
+ longer be needed.
- Improved :doc:`bugprone-unhandled-self-assignment
<clang-tidy/checks/bugprone/unhandled-self-assignment>` check by fixing smart
|
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.
does check doc need to be changed also?
We updated some earlier, but not the later section about recommending binding to a local variable. Also did not update w.r.t. smart pointer like APIs.
Good question -- I don't see the option IgnoreSmartPointerDereference advertised in the check docs. Otherwise, we partially updated the check docs about earlier accessor caching. Updated more to mention smart pointer like APIs. Also previously updated internal code comments about IgnoreSmartPointerDereference in the |
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.
Could you please also move readability-identifier-naming
entry before readability-implicit-bool-conversion
and place :program:run-clang-tidy.py
entry after :program:clang-tidy.py
?
Sure thing -- Done separately in #122475 (I kept the "Improved" cluster together, vs moving For |
clang-tools-extra/docs/clang-tidy/checks/bugprone/unchecked-optional-access.rst
Outdated
Show resolved
Hide resolved
… pointer caching (llvm#122290) With caching added in llvm#120249, the `IgnoreSmartPointerDereference` option shouldn't be needed anymore. Other caching also added earlier: llvm#112605
With caching added in #120249, the
IgnoreSmartPointerDereference
option shouldn't be needed anymore.Other caching also added earlier: #112605