[clang-tools-extra] [clang-tidy] Add a release note about unchecked-optional-access smart pointer caching (PR #122290)

Jan Voung via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 9 07:20:35 PST 2025


https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/122290

>From 342ff1a05caa6943fe8a86415f30b433ac30106f Mon Sep 17 00:00:00 2001
From: Jan Voung <jvoung at gmail.com>
Date: Thu, 9 Jan 2025 14:10:30 +0000
Subject: [PATCH 1/2] [clang-tidy] Add a release note about
 unchecked-optional-access smart pointer caching

With caching added in https://github.com/llvm/llvm-project/pull/120249,
inform in notes that the `IgnoreSmartPointerDereference` option shouldn't
be needed anymore.

Other caching also added earlier:
https://github.com/llvm/llvm-project/pull/112605
---
 clang-tools-extra/docs/ReleaseNotes.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index 94e15639c4a92e..f325b9ecbe1547 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -232,6 +232,9 @@ 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`` are now fixed by now caching.
+  So 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

>From 5ca75af3d62de29313032b7673106ac3fcd0d9f7 Mon Sep 17 00:00:00 2001
From: Jan Voung <jvoung at gmail.com>
Date: Thu, 9 Jan 2025 15:20:00 +0000
Subject: [PATCH 2/2] Clean up text

---
 clang-tools-extra/docs/ReleaseNotes.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index f325b9ecbe1547..47cc4f6f17fed5 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -233,8 +233,9 @@ Changes in existing checks
   `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`` are now fixed by now caching.
-  So the option `IgnoreSmartPointerDereference` should no longer be needed.
+  ``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



More information about the cfe-commits mailing list