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

Side by Side Diff: tools/clang/plugins/tests/weak_ptr_factory.cpp

Issue 26303002: Make Clang plugin check WeakPtrFactory member order (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up for review Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 #include "weak_ptr_factory.h"
6 namespace should_succeed {
7
8 class OnlyMember {
9 base::WeakPtrFactory<OnlyMember> factory_;
10 };
11
12 class FactoryLast {
13 bool bool_member_;
14 int int_member_;
15 base::WeakPtrFactory<FactoryLast> factory_;
16 };
17
18 class FactoryRefersToOtherType {
19 bool bool_member_;
20 base::WeakPtrFactory<bool> bool_ptr_factory_;
21 };
22
23 class FirstFactoryRefersToOtherType {
24 bool bool_member_;
25 base::WeakPtrFactory<bool> bool_ptr_factory_;
26 int int_member_;
27 base::WeakPtrFactory<FirstFactoryRefersToOtherType> factory_;
28 };
29
30 } // namespace should_succeed
31
32 namespace should_fail {
33
34 class FactoryFirst {
35 base::WeakPtrFactory<FactoryFirst> factory_;
36 int int_member;
37 };
38
39 class FactoryMiddle {
40 bool bool_member_;
41 base::WeakPtrFactory<FactoryMiddle> factory_;
42 int int_member_;
43 };
44
45 } // namespace should_fail
46
47 int main() {
48 }
49
OLDNEW
« no previous file with comments | « tools/clang/plugins/tests/weak_ptr_factory.h ('k') | tools/clang/plugins/tests/weak_ptr_factory.flags » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698