summaryrefslogtreecommitdiffstats
path: root/build/clang-plugin/tests/TestNoExplicitMoveConstructor.cpp
blob: 5aea6b1a7f4718979a97de073e36b46250cefdca (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
class Foo {
  Foo(Foo&& f);
};

class Bar {
  explicit Bar(Bar&& f); // expected-error {{Move constructors may not be marked explicit}}
};

class Baz {
  template<typename T>
  explicit Baz(T&& f) {};
};

class Quxx {
  Quxx();
  Quxx(Quxx& q) = delete;
  template<typename T>
  explicit Quxx(T&& f) {};
};

void f() {
  // Move a quxx into a quxx! (This speciailizes Quxx's constructor to look like
  // a move constructor - to make sure it doesn't trigger)
  Quxx(Quxx());
}