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

Side by Side Diff: tools/clang/rewrite_to_chrome_style/tests/fields-original.cc

Issue 1639133004: rewrite_to_chrome_style: skip nodes in synthesized functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 namespace blink { 5 namespace blink {
6 6
7 class C { 7 class C {
danakj 2016/01/28 23:08:20 Can you add a comment saying that adding a copy/mo
dcheng 2016/01/28 23:15:43 Done.
8 public: 8 public:
9 // Make sure initializers are updated to use the new names. 9 // Make sure initializers are updated to use the new names.
10 C() : m_flagField(~0), m_fieldMentioningHTTPAndHTTPS(1) {} 10 C() : m_flagField(~0), m_fieldMentioningHTTPAndHTTPS(1) {}
11 11
12 int method() { 12 int method() {
13 // Test that references to fields are updated correctly. 13 // Test that references to fields are updated correctly.
14 return instanceCount + m_flagField + m_fieldMentioningHTTPAndHTTPS; 14 return instanceCount + m_flagField + m_fieldMentioningHTTPAndHTTPS;
15 } 15 }
16 16
17 // Test that a field without a m_ prefix is correctly renamed. 17 // Test that a field without a m_ prefix is correctly renamed.
(...skipping 25 matching lines...) Expand all
43 char fourChars[4]; 43 char fourChars[4];
44 short twoShorts[2]; 44 short twoShorts[2];
45 int one_hopefully_four_byte_int; 45 int one_hopefully_four_byte_int;
46 }; 46 };
47 47
48 } // namespace blink 48 } // namespace blink
49 49
50 void F() { 50 void F() {
51 // Test that references to a static field are correctly rewritten. 51 // Test that references to a static field are correctly rewritten.
52 blink::C::instanceCount++; 52 blink::C::instanceCount++;
53 // Force instantiation of a copy constructor for blink::C to make sure field
dcheng 2016/01/28 06:07:32 I couldn't repro this with an explicitly defaulted
54 // initializers for synthesized functions don't cause weird rewrites.
55 blink::C c;
56 blink::C c2 = c;
53 } 57 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698