This revision was automatically updated to reflect the committed changes.
Closed by commit rL268461: [clang-tidy] MoveConstructorInitCheck - Add 
parameter name to check message. (authored by flx).

Changed prior to commit:
  http://reviews.llvm.org/D19849?vs=55975&id=56076#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19849

Files:
  clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.cpp
  clang-tools-extra/trunk/test/clang-tidy/misc-move-constructor-init.cpp

Index: clang-tools-extra/trunk/test/clang-tidy/misc-move-constructor-init.cpp
===================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-move-constructor-init.cpp
+++ clang-tools-extra/trunk/test/clang-tidy/misc-move-constructor-init.cpp
@@ -96,7 +96,7 @@
 
 struct Positive {
   Positive(Movable M) : M_(M) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: value argument can be moved to 
avoid copy [misc-move-constructor-init]
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: value argument 'M' can be moved 
to avoid copy [misc-move-constructor-init]
   // CHECK-FIXES: Positive(Movable M) : M_(std::move(M)) {}
   Movable M_;
 };
Index: clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.cpp
@@ -109,8 +109,9 @@
   if (parmVarDeclRefExprOccurences(*MovableParam, *ConstructorDecl,
                                    *Result.Context) > 1)
     return;
-  auto DiagOut =
-      diag(InitArg->getLocStart(), "value argument can be moved to avoid 
copy");
+  auto DiagOut = diag(InitArg->getLocStart(),
+                      "value argument %0 can be moved to avoid copy")
+                 << MovableParam;
   DiagOut << FixItHint::CreateReplacement(
       InitArg->getSourceRange(),
       (Twine("std::move(") + MovableParam->getName() + ")").str());


Index: clang-tools-extra/trunk/test/clang-tidy/misc-move-constructor-init.cpp
===================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-move-constructor-init.cpp
+++ clang-tools-extra/trunk/test/clang-tidy/misc-move-constructor-init.cpp
@@ -96,7 +96,7 @@
 
 struct Positive {
   Positive(Movable M) : M_(M) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: value argument can be moved to avoid copy [misc-move-constructor-init]
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: value argument 'M' can be moved to avoid copy [misc-move-constructor-init]
   // CHECK-FIXES: Positive(Movable M) : M_(std::move(M)) {}
   Movable M_;
 };
Index: clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.cpp
@@ -109,8 +109,9 @@
   if (parmVarDeclRefExprOccurences(*MovableParam, *ConstructorDecl,
                                    *Result.Context) > 1)
     return;
-  auto DiagOut =
-      diag(InitArg->getLocStart(), "value argument can be moved to avoid copy");
+  auto DiagOut = diag(InitArg->getLocStart(),
+                      "value argument %0 can be moved to avoid copy")
+                 << MovableParam;
   DiagOut << FixItHint::CreateReplacement(
       InitArg->getSourceRange(),
       (Twine("std::move(") + MovableParam->getName() + ")").str());
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to