summaryrefslogtreecommitdiffstats
path: root/tools/clang-tidy/test/performance-move-const-arg.cpp
blob: 39f1ce06ec671576e862eaaf5e18a7a667c1f8cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
namespace std {
template <typename _Tp>
struct remove_reference {
  typedef _Tp type;
};

template <typename _Tp>
constexpr typename std::remove_reference<_Tp>::type &&move(_Tp &&__t) {
  return static_cast<typename std::remove_reference<_Tp>::type &&>(__t);
}
} // namespace std

struct TriviallyCopyable {
  int i;
};

class A {
public:
  A() {}
  A(const A &rhs) {}
  A(A &&rhs) {}
};

void f(TriviallyCopyable) {}

void g() {
  TriviallyCopyable obj;
  f(std::move(obj));
}

A f5(const A x5) {
  return std::move(x5);
}