From 1af58fc1e545847e67cbc6a6e8c530b19845d908 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Tue, 26 Apr 2016 18:48:59 +0000 Subject: [PATCH] [clang-tidy] Added misc-move-const-arg docs. llvm-svn: 267587 --- clang-tools-extra/docs/clang-tidy/checks/list.rst | 3 ++- .../docs/clang-tidy/checks/misc-move-const-arg.rst | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 clang-tools-extra/docs/clang-tidy/checks/misc-move-const-arg.rst diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst index 113b341..c85d7e7 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -61,6 +61,7 @@ Clang-Tidy Checks misc-macro-parentheses misc-macro-repeated-side-effects misc-misplaced-widening-cast + misc-move-const-arg misc-move-constructor-init misc-multiple-statement-macro misc-new-delete-overloads @@ -76,7 +77,7 @@ Clang-Tidy Checks misc-string-literal-with-embedded-nul misc-suspicious-missing-comma misc-suspicious-semicolon - misc-suspicious-string-compare + misc-suspicious-string-compare misc-swapped-arguments misc-throw-by-value-catch-by-reference misc-undelegated-constructor diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-move-const-arg.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-move-const-arg.rst new file mode 100644 index 0000000..b09e0a1 --- /dev/null +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-move-const-arg.rst @@ -0,0 +1,15 @@ +.. title:: clang-tidy - misc-move-const-arg + +misc-move-const-arg +=================== + +The check warns if the result of ``std::move(x)`` is bound to a constant +reference argument, e.g.: + +.. code:: c++ + + void f(const string&); + void g() { + string s; + F(std::move(s)); // Warning here. std::move() is not moving anything. + } -- 2.7.4