diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst index f53dd545df5a9e..402ed1b4326a8f 100644 --- a/clang/docs/analyzer/checkers.rst +++ b/clang/docs/analyzer/checkers.rst @@ -416,6 +416,25 @@ around, such as ``std::string_view``. // note: inner buffer of 'std::string' deallocated by call to destructor } +.. _cplusplus-Move: + +cplusplus.Move (C++) +"""""""""""""""""""" +Method calls on a moved-from object and copying a moved-from object will be reported. + + +.. code-block:: cpp + + struct A { + void foo() {} + }; + + void f() { + A a; + A b = std::move(a); // note: 'a' became 'moved-from' here + a.foo(); // warn: method call on a 'moved-from' object 'a' + } + .. _cplusplus-NewDelete: cplusplus.NewDelete (C++) @@ -2599,25 +2618,6 @@ Check for use of iterators of different containers where iterators of the same c // expected } -.. _alpha-cplusplus-MisusedMovedObject: - -alpha.cplusplus.MisusedMovedObject (C++) -"""""""""""""""""""""""""""""""""""""""" -Method calls on a moved-from object and copying a moved-from object will be reported. - - -.. code-block:: cpp - - struct A { - void foo() {} - }; - - void f() { - A a; - A b = std::move(a); // note: 'a' became 'moved-from' here - a.foo(); // warn: method call on a 'moved-from' object 'a' - } - .. _alpha-cplusplus-SmartPtr: alpha.cplusplus.SmartPtr (C++)