From 2e515ed60a6d63610a7b0d485158ca4d32f9cbce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 20 Jun 2024 16:41:51 +0200 Subject: [PATCH] [clang] Move 'alpha.cplusplus.MisusedMovedObject' to 'cplusplus.Move' in documentation (NFC) (#95003) The checker was renamed at some time ago but the documentation was not updated. The section is now just moved and renamed. The documentation is still very simple and needs improvement. --- clang/docs/analyzer/checkers.rst | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst index d76ee241da797e..b8d5f372bdf619 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++) @@ -2584,25 +2603,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++)