Re: [clang-tools-extra] r270567 - [clang-tidy] modernize-pass-by-value bugfix. Reverting lit-style test

2016-05-24 Thread Renato Golin via cfe-commits
On 24 May 2016 at 16:13, Mads Ravn via cfe-commits
 wrote:
> Author: madsravn
> Date: Tue May 24 10:13:44 2016
> New Revision: 270567
>
> URL: http://llvm.org/viewvc/llvm-project?rev=270567=rev
> Log:
> [clang-tidy] modernize-pass-by-value bugfix. Reverting lit-style test
>
> Adding to revision 270565. The lit-style test was wrong. This is being fixed 
> by this commit.

Still haven't fixed the ARM bots:

http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/12383

http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/7290

http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15/builds/12665

cheers,
--renato
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] r270567 - [clang-tidy] modernize-pass-by-value bugfix. Reverting lit-style test

2016-05-24 Thread Mads Ravn via cfe-commits
Author: madsravn
Date: Tue May 24 10:13:44 2016
New Revision: 270567

URL: http://llvm.org/viewvc/llvm-project?rev=270567=rev
Log:
[clang-tidy] modernize-pass-by-value bugfix. Reverting lit-style test

Adding to revision 270565. The lit-style test was wrong. This is being fixed by 
this commit.

This is the bug on bugzilla: https://llvm.org/bugs/show_bug.cgi?id=27731

This is the code review on phabricator: http://reviews.llvm.org/D20365

Modified:
clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp

Modified: clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp?rev=270567=270566=270567=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp Tue May 
24 10:13:44 2016
@@ -1,9 +1,7 @@
-#include 
-#include 
-
 // RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -std=c++11 
-fno-delayed-template-parsing
 
 // CHECK-FIXES: #include 
+#include 
 
 namespace {
 // POD types are trivially move constructible.
@@ -20,7 +18,7 @@ struct NotMovable {
 }
 
 struct A {
-  A(Movable M) : M(std::move(M)) {}
+  A(const Movable ) : M(M) {}
   // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move 
[modernize-pass-by-value]
   // CHECK-FIXES: A(Movable M) : M(std::move(M)) {}
   Movable M;
@@ -49,17 +47,17 @@ struct C {
 
 // Test that both declaration and definition are updated.
 struct D {
-  D(Movable M);
+  D(const Movable );
   // CHECK-FIXES: D(Movable M);
   Movable M;
 };
-D::D(Movable M) : M(std::move(M)) {}
+D::D(const Movable ) : M(M) {}
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: pass by value and use std::move
 // CHECK-FIXES: D::D(Movable M) : M(std::move(M)) {}
 
 // Test with default parameter.
 struct E {
-  E(Movable M = Movable()) : M(std::move(M)) {}
+  E(const Movable  = Movable()) : M(M) {}
   // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move
   // CHECK-FIXES: E(Movable M = Movable()) : M(std::move(M)) {}
   Movable M;
@@ -74,11 +72,11 @@ struct F {
 
 // Test unnamed parameter in declaration.
 struct G {
-  G(Movable );
+  G(const Movable &);
   // CHECK-FIXES: G(Movable );
   Movable M;
 };
-G::G(Movable M) : M(std::move(M)) {}
+G::G(const Movable ) : M(M) {}
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: pass by value and use std::move
 // CHECK-FIXES: G::G(Movable M) : M(std::move(M)) {}
 
@@ -87,12 +85,12 @@ namespace ns_H {
 typedef ::Movable HMovable;
 }
 struct H {
-  H(ns_H::HMovable M);
+  H(const ns_H::HMovable );
   // CHECK-FIXES: H(ns_H::HMovable M);
   ns_H::HMovable M;
 };
 using namespace ns_H;
-H::H(HMovable M) : M(std::move(M)) {}
+H::H(const HMovable ) : M(M) {}
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: pass by value and use std::move
 // CHECK-FIXES: H(HMovable M) : M(std::move(M)) {}
 
@@ -125,14 +123,14 @@ struct K_Movable {
 
 // Test with movable type with an user defined move constructor.
 struct K {
-  K(K_Movable M) : M(std::move(M)) {}
+  K(const K_Movable ) : M(M) {}
   // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move
   // CHECK-FIXES: K(K_Movable M) : M(std::move(M)) {}
   K_Movable M;
 };
 
 template  struct L {
-  L(Movable M) : M(std::move(M)) {}
+  L(const Movable ) : M(M) {}
   // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move
   // CHECK-FIXES: L(Movable M) : M(std::move(M)) {}
   Movable M;
@@ -141,7 +139,7 @@ L l(Movable());
 
 // Test with a non-instantiated template class.
 template  struct N {
-  N(Movable M) : M(std::move(M)) {}
+  N(const Movable ) : M(M) {}
   // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move
   // CHECK-FIXES: N(Movable M) : M(std::move(M)) {}
 
@@ -151,7 +149,7 @@ template  struct N {
 
 // Test with value parameter.
 struct O {
-  O(Movable M) : M(std::move(M)) {}
+  O(Movable M) : M(M) {}
   // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move
   // CHECK-FIXES: O(Movable M) : M(std::move(M)) {}
   Movable M;
@@ -167,8 +165,8 @@ struct P {
 // Test with multiples parameters where some need to be changed and some don't.
 // need to.
 struct Q {
-  Q(const Movable , Movable B, Movable C, double D)
-  : A(A), B(std::move(B)), C(std::move(C)), D(D) {}
+  Q(const Movable , const Movable , const Movable , double D)
+  : A(A), B(B), C(C), D(D) {}
   // CHECK-MESSAGES: :[[@LINE-2]]:23: warning: pass by value and use std::move
   // CHECK-MESSAGES: :[[@LINE-3]]:41: warning: pass by value and use std::move
   // CHECK-FIXES:  Q(const Movable , Movable B, Movable C, double D)
@@ -184,7 +182,7 @@ namespace ns_R {
 typedef ::Movable RMovable;
 }
 struct R {
-  R(ns_R::RMovable M) : M(std::move(M)) {}
+  R(ns_R::RMovable M) : M(M) {}
   // CHECK-MESSAGES: