diff options
| author | Gabor Horvath <xazax.hun@gmail.com> | 2016-05-04 12:02:22 +0000 |
|---|---|---|
| committer | Gabor Horvath <xazax.hun@gmail.com> | 2016-05-04 12:02:22 +0000 |
| commit | 112d1e80c061e35c61c4d2f4da5b8b3c624812b2 (patch) | |
| tree | 5b3bc6fd13c711d3b8a2c7d8aed46a0ccc26d060 /clang-tools-extra/docs | |
| parent | 4807f829b4457a35ce5b9e2fd780cbf748612944 (diff) | |
| download | bcm5719-llvm-112d1e80c061e35c61c4d2f4da5b8b3c624812b2.tar.gz bcm5719-llvm-112d1e80c061e35c61c4d2f4da5b8b3c624812b2.zip | |
[clang-tidy] New: checker misc-unconventional-assign-operator replacing misc-assign-operator-signature
Summary: Finds return statements in assign operator bodies where the return value is different from '*this'. Only assignment operators with correct return value Class& are checked.
Reviewers: aaron.ballman, alexfh, sbenza
Subscribers: o.gyorgy, baloghadamsoftware, LegalizeAdulthood, aaron.ballman, Eugene.Zelenko, xazax.hun, cfe-commits
Differential Revision: http://reviews.llvm.org/D18265
llvm-svn: 268492
Diffstat (limited to 'clang-tools-extra/docs')
4 files changed, 20 insertions, 13 deletions
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index e4a88b21de9..5a246115b8c 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -236,6 +236,12 @@ identified. The improvements since the 3.8 release include: Finds static function and variable definitions in anonymous namespace. +- New `misc-unconventional-assign-operator + <http://clang.llvm.org/extra/clang-tidy/checks/misc-unconventional-assign-operator.html>`_ check replacing old `misc-assign-operator-signature` check + + Does not only checks for correct signature but also for correct ``return`` + statements (returning ``*this``) + Fixed bugs: - Crash when running on compile database with relative source files paths. diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst index d5c680c653c..7459734afda 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -52,7 +52,7 @@ Clang-Tidy Checks llvm-twine-local misc-argument-comment misc-assert-side-effect - misc-assign-operator-signature + misc-unconventional-assign-operator misc-bool-pointer-implicit-conversion misc-dangling-handle misc-definitions-in-headers diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-assign-operator-signature.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-assign-operator-signature.rst deleted file mode 100644 index dc34e1181a1..00000000000 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-assign-operator-signature.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. title:: clang-tidy - misc-assign-operator-signature - -misc-assign-operator-signature -============================== - - -Finds declarations of assign operators with the wrong return and/or argument -types. - - * The return type must be ``Class&``. - * Works with move-assign and assign by value. - * Private and deleted operators are ignored. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-unconventional-assign-operator.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-unconventional-assign-operator.rst new file mode 100644 index 00000000000..e12241b071b --- /dev/null +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-unconventional-assign-operator.rst @@ -0,0 +1,13 @@ +.. title:: clang-tidy - misc-unconventional-assign-operator + +misc-unconventional-assign-operator +==================== + + +Finds declarations of assign operators with the wrong return and/or argument +types and definitions with good return type but wrong return statements. + + * The return type must be ``Class&``. + * Works with move-assign and assign by value. + * Private and deleted operators are ignored. + * The operator must always return ``*this``. |

