blob: 5bfe680f58353b08ef6675a6f273b1b3c43a47d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -isystem %S/Inputs/Headers
// CHECK-FIXES: #include <utility>
#define HEADER <./a.h>
#include HEADER
struct A {
A(const A &) {}
A(A &&) {}
};
struct B {
B(const A &a) : a(a) {}
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move [modernize-pass-by-value]
// CHECK-FIXES: B(A a) : a(std::move(a)) {}
A a;
};
|