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

Side by Side Diff: tools/clang/rewrite_scoped_refptr/tests/test9-original.cc

Issue 446203003: scoped_refptr implicit conversion cleanup tool. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 4 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 "scoped_refptr.h"
6
7 struct Foo {
8 int dummy;
9 };
10
11 struct HasAScopedRefptr {
12 scoped_refptr<Foo> member;
13
14 const scoped_refptr<Foo>& GetMemberAsScopedRefptr() const { return member; }
15
16 Foo* GetMemberAsRawPtr() const { return member; }
17 };
18
19 void ExpectsRawPtr(Foo* param) {
20 Foo* temp = param;
21 }
22
23 void ExpectsScopedRefptr(const scoped_refptr<Foo>& param) {
24 Foo* temp = param.get();
25 }
26
27 void CallsRawWithMemberScopedRefptr() {
28 HasAScopedRefptr object;
29 ExpectsRawPtr(object.GetMemberAsScopedRefptr());
30 }
31
32 void CallsRawWithMemberRawPtr() {
33 HasAScopedRefptr object;
34 ExpectsRawPtr(object.GetMemberAsRawPtr());
35 }
36
37 void CallsScopedWithMemberScopedRefptr() {
38 HasAScopedRefptr object;
39 ExpectsScopedRefptr(object.GetMemberAsScopedRefptr());
40 }
41
42 void CallsScopedWithMemberRawPtr() {
43 HasAScopedRefptr object;
44 ExpectsScopedRefptr(object.GetMemberAsScopedRefptr());
45 }
OLDNEW
« no previous file with comments | « tools/clang/rewrite_scoped_refptr/tests/test9-expected.cc ('k') | tools/clang/scripts/run_tool.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698