Skip to content

Commit 32a6c3c

Browse files
balazskeAlexisPerry
authored andcommitted
[clang] Move 'alpha.cplusplus.MisusedMovedObject' to 'cplusplus.Move' in documentation (NFC) (llvm#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.
1 parent 823898c commit 32a6c3c

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

clang/docs/analyzer/checkers.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,25 @@ around, such as ``std::string_view``.
416416
// note: inner buffer of 'std::string' deallocated by call to destructor
417417
}
418418
419+
.. _cplusplus-Move:
420+
421+
cplusplus.Move (C++)
422+
""""""""""""""""""""
423+
Method calls on a moved-from object and copying a moved-from object will be reported.
424+
425+
426+
.. code-block:: cpp
427+
428+
struct A {
429+
void foo() {}
430+
};
431+
432+
void f() {
433+
A a;
434+
A b = std::move(a); // note: 'a' became 'moved-from' here
435+
a.foo(); // warn: method call on a 'moved-from' object 'a'
436+
}
437+
419438
.. _cplusplus-NewDelete:
420439
421440
cplusplus.NewDelete (C++)
@@ -2584,25 +2603,6 @@ Check for use of iterators of different containers where iterators of the same c
25842603
// expected
25852604
}
25862605
2587-
.. _alpha-cplusplus-MisusedMovedObject:
2588-
2589-
alpha.cplusplus.MisusedMovedObject (C++)
2590-
""""""""""""""""""""""""""""""""""""""""
2591-
Method calls on a moved-from object and copying a moved-from object will be reported.
2592-
2593-
2594-
.. code-block:: cpp
2595-
2596-
struct A {
2597-
void foo() {}
2598-
};
2599-
2600-
void f() {
2601-
A a;
2602-
A b = std::move(a); // note: 'a' became 'moved-from' here
2603-
a.foo(); // warn: method call on a 'moved-from' object 'a'
2604-
}
2605-
26062606
.. _alpha-cplusplus-SmartPtr:
26072607
26082608
alpha.cplusplus.SmartPtr (C++)

0 commit comments

Comments
 (0)