[MD settings] moving attached() code
[chromium-blink-merge.git] / tools / clang / plugins / tests / missing_ctor.h
blob2587a10d9e75dd80b018d4ef771ca4ca4c82a92e
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MISSING_CTOR_H_
6 #define MISSING_CTOR_H_
8 struct MyString {
9 MyString();
10 ~MyString();
11 MyString(const MyString&);
12 MyString(MyString&&);
15 template <class T>
16 struct MyVector {
17 MyVector();
18 ~MyVector();
19 MyVector(const MyVector&);
20 MyVector(MyVector&&);
23 // Note: this should warn for an implicit copy constructor too, but currently
24 // doesn't, due to a plugin bug.
25 class MissingCtorsArentOKInHeader {
26 public:
28 private:
29 MyVector<int> one_;
30 MyVector<MyString> two_;
33 // Inline move ctors shouldn't be warned about. Similar to the previous test
34 // case, this also incorrectly fails to warn for the implicit copy ctor.
35 class InlineImplicitMoveCtorOK {
36 public:
37 InlineImplicitMoveCtorOK();
39 private:
40 // ctor weight = 12, dtor weight = 9.
41 MyString one_;
42 MyString two_;
43 MyString three_;
44 int four_;
45 int five_;
46 int six_;
49 class ExplicitlyDefaultedInlineAlsoWarns {
50 public:
51 ExplicitlyDefaultedInlineAlsoWarns() = default;
52 ~ExplicitlyDefaultedInlineAlsoWarns() = default;
53 ExplicitlyDefaultedInlineAlsoWarns(
54 const ExplicitlyDefaultedInlineAlsoWarns&) = default;
56 private:
57 MyVector<int> one_;
58 MyVector<MyString> two_;
62 #endif // MISSING_CTOR_H_