Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: tools/clang/plugins/tests/missing_ctor.h

Issue 1385193002: Bisect clang Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 246985 Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/clang/plugins/tests/inline_ctor.txt ('k') | tools/clang/plugins/tests/missing_ctor.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef MISSING_CTOR_H_
6 #define MISSING_CTOR_H_
7
8 struct MyString {
9 MyString();
10 ~MyString();
11 MyString(const MyString&);
12 MyString(MyString&&);
13 };
14
15 template <class T>
16 struct MyVector {
17 MyVector();
18 ~MyVector();
19 MyVector(const MyVector&);
20 MyVector(MyVector&&);
21 };
22
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:
27
28 private:
29 MyVector<int> one_;
30 MyVector<MyString> two_;
31 };
32
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();
38
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_;
47 };
48
49 class ExplicitlyDefaultedInlineAlsoWarns {
50 public:
51 ExplicitlyDefaultedInlineAlsoWarns() = default;
52 ~ExplicitlyDefaultedInlineAlsoWarns() = default;
53 ExplicitlyDefaultedInlineAlsoWarns(
54 const ExplicitlyDefaultedInlineAlsoWarns&) = default;
55
56 private:
57 MyVector<int> one_;
58 MyVector<MyString> two_;
59
60 };
61
62 #endif // MISSING_CTOR_H_
OLDNEW
« no previous file with comments | « tools/clang/plugins/tests/inline_ctor.txt ('k') | tools/clang/plugins/tests/missing_ctor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698