You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang-tools-extra/test/clang-tidy/misc-move-const-arg.cpp
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -23,27 +23,27 @@ class A {
23
23
24
24
intf1() {
25
25
returnstd::move(42);
26
-
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the expression of a trivially-copyable type has no effect; remove std::move() [misc-move-const-arg]
26
+
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the expression of the trivially-copyable type 'int' has no effect; remove std::move() [misc-move-const-arg]
27
27
// CHECK-FIXES: return 42;
28
28
}
29
29
30
30
intf2(int x2) {
31
31
returnstd::move(x2);
32
-
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the variable of a trivially-copyable type
32
+
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the variable 'x2' of the trivially-copyable type 'int'
33
33
// CHECK-FIXES: return x2;
34
34
}
35
35
36
36
int *f3(int *x3) {
37
37
returnstd::move(x3);
38
-
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the variable of a trivially-copyable type
38
+
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the variable 'x3' of the trivially-copyable type 'int *'
39
39
// CHECK-FIXES: return x3;
40
40
}
41
41
42
42
A f4(A x4) { returnstd::move(x4); }
43
43
44
44
A f5(const A x5) {
45
45
returnstd::move(x5);
46
-
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the const variable
46
+
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the const variable 'x5' has no effect; remove std::move() or make the variable non-const [misc-move-const-arg]
47
47
// CHECK-FIXES: return x5;
48
48
}
49
49
@@ -55,7 +55,7 @@ void f7() { int a = f6(10); }
55
55
voidf8() {
56
56
const A a;
57
57
M1(A b = std::move(a);)
58
-
// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: std::move of the const variable
58
+
// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: std::move of the const variable 'a' has no effect; remove std::move() or make the variable non-const
59
59
// CHECK-FIXES: M1(A b = a;)
60
60
}
61
61
@@ -64,7 +64,7 @@ int f9() { return M2(1); }
64
64
65
65
template <typename T> T f10(constint x10) {
66
66
returnstd::move(x10);
67
-
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the const variable
67
+
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: std::move of the const variable 'x10' of the trivially-copyable type 'const int' has no effect; remove std::move() [misc-move-const-arg]
0 commit comments