Skip to content

Commit

Permalink
[clang] Move 'alpha.cplusplus.MisusedMovedObject' to 'cplusplus.Move'…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
balazske authored Jun 20, 2024
1 parent 3e55ac9 commit 2e515ed
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions clang/docs/analyzer/checkers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down Expand Up @@ -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++)
Expand Down

0 comments on commit 2e515ed

Please sign in to comment.