[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
Mon Jan 13 12:19:33 PST 2025


================
@@ -81,10 +81,12 @@ Exception: accessor methods
 
 The check assumes *accessor* methods of a class are stable, with a heuristic to
 determine which methods are accessors. Specifically, parameter-free ``const``
-methods are treated as accessors. Note that this is not guaranteed to be safe
--- but, it is widely used (safely) in practice, and so we have chosen to treat
-it as generally safe. Calls to non ``const`` methods are assumed to modify
-the state of the object and affect the stability of earlier accessor calls.
+methods and smart pointer-like APIs (non ``const`` overloads of ``*`` when
+there is a parallel ``const`` overload) are treated as accessors. Note that
+this is not guaranteed to be safe -- but, it is widely used (safely) in
+practice, and so we have chosen to treat it as generally safe. Calls to non
----------------
jvoung wrote:

Done

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


More information about the cfe-commits mailing list