xref: /llvm-project/clang-tools-extra/docs/clang-tidy/checks/misc/unconventional-assign-operator.rst (revision 6d3725924fe6adf0d490697327938de9c3516cbe)
1.. title:: clang-tidy - misc-unconventional-assign-operator
2
3misc-unconventional-assign-operator
4===================================
5
6
7Finds declarations of assign operators with the wrong return and/or argument
8types 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