From 5dee50111c13bbc4480401e2eaa67f6bca1b480a Mon Sep 17 00:00:00 2001 From: Deep Majumder Date: Mon, 20 Sep 2021 20:12:26 +0530 Subject: [PATCH] [analyzer] Move docs of SmartPtr to correct subcategory The docs of alpha.cplusplus.SmartPtr was incorrectly placed under alpha.deadcode. Moved it to under alpha.cplusplus Differential Revision: https://reviews.llvm.org/D110032 --- clang/docs/analyzer/checkers.rst | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst index 858c8e1303e8..89190b54e5a5 100644 --- a/clang/docs/analyzer/checkers.rst +++ b/clang/docs/analyzer/checkers.rst @@ -1838,6 +1838,20 @@ Method calls on a moved-from object and copying a moved-from object will be repo a.foo(); // warn: method call on a 'moved-from' object 'a' } +.. _alpha-cplusplus-SmartPtr: + +alpha.cplusplus.SmartPtr (C++) +"""""""""""""""""""""""""""""" +Check for dereference of null smart pointers. + +.. code-block:: cpp + + void deref_smart_ptr() { + std::unique_ptr P; + *P; // warn: dereference of a default constructed smart unique_ptr + } + + alpha.deadcode ^^^^^^^^^^^^^^ .. _alpha-deadcode-UnreachableCode: @@ -1872,19 +1886,6 @@ Check unreachable code. [x retain]; // warn } -.. _alpha-cplusplus-SmartPtr: - -alpha.cplusplus.SmartPtr (C++) -"""""""""""""""""""""""""""""" -Check for dereference of null smart pointers. - -.. code-block:: cpp - - void deref_smart_ptr() { - std::unique_ptr P; - *P; // warn: dereference of a default constructed smart unique_ptr - } - alpha.fuchsia ^^^^^^^^^^^^^