Debian Codegraph @

clang-tools-extra/docs/clang-tidy/checks/misc/unconventional-assign-operator.rst

raw
1 .. title:: clang-tidy - misc-unconventional-assign-operator
2
3 misc-unconventional-assign-operator
4 ===================================
5
6
7 Finds declarations of assign operators with the wrong return and/or argument
8 types and definitions with good return type but wrong ``return`` statements.
9
10 * The return type must be ``Class&``.
11 * The assignment may be from the class type by value, const lvalue
12 reference, non-const rvalue reference, or from a completely different
13 type (e.g. ``int``).
14 * Private and deleted operators are ignored.
15 * The operator must always return ``*this``.
16
17 This check implements `AUTOSAR C++14 Rule A13-2-1
18 <https://www.autosar.org/fileadmin/standards/R22-11/AP/AUTOSAR_RS_CPP14Guidelines.pdf>`_.