forked from OSchip/llvm-project
[clang-tidy] modernize-pass-by-value bugfix. Reverting lit-style test
Adding to revision 270567. 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 llvm-svn: 270575
This commit is contained in:
parent
1f5696f9c1
commit
ef88dc8fe4
|
@ -150,8 +150,7 @@ template <typename T> struct N {
|
|||
// Test with value parameter.
|
||||
struct O {
|
||||
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)) {}
|
||||
// CHECK-FIXES: O(Movable M) : M(M) {}
|
||||
Movable M;
|
||||
};
|
||||
|
||||
|
@ -183,8 +182,7 @@ typedef ::Movable RMovable;
|
|||
}
|
||||
struct R {
|
||||
R(ns_R::RMovable M) : M(M) {}
|
||||
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move
|
||||
// CHECK-FIXES: R(ns_R::RMovable M) : M(std::move(M)) {}
|
||||
// CHECK-FIXES: R(ns_R::RMovable M) : M(M) {}
|
||||
ns_R::RMovable M;
|
||||
};
|
||||
|
||||
|
@ -198,6 +196,7 @@ struct S {
|
|||
// Test that types that are trivially copyable will not use std::move. This will
|
||||
// cause problems with misc-move-const-arg, as it will revert it.
|
||||
struct T {
|
||||
std::array<int, 10> a_;
|
||||
T(std::array<int, 10> a) : a_(a) {}
|
||||
// CHECK-FIXES: T(std::array<int, 10> a) : a_(a) {}
|
||||
std::array<int, 10> a_;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue