diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst --- a/clang/docs/analyzer/checkers.rst +++ b/clang/docs/analyzer/checkers.rst @@ -1838,6 +1838,20 @@ 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 @@ [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 ^^^^^^^^^^^^^