brintos

brintos / llvm-project-archived public Read only

0
0
Text · 407 B · 384a86d Raw
19 lines · cpp
1// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -isystem %clang_tidy_headers2 3// CHECK-FIXES: #include <utility>4 5#define HEADER <./a.h>6#include HEADER7 8struct A {9  A(const A &) {}10  A(A &&) {}11};12 13struct 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