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