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

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

Issue 2256913002: Handling of DependentScopeDeclRefExpr and CXXDependentScopeMemberExpr nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink-style-new-clang
Patch Set: Tweaked a comment + fixed a typo. Created 4 years 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 // Note: do not add any copy or move constructors to this class: doing so will 7 // Note: do not add any copy or move constructors to this class: doing so will
8 // break test coverage that we don't clobber the class name by trying to emit 8 // break test coverage that we don't clobber the class name by trying to emit
9 // replacements for synthesized functions. 9 // replacements for synthesized functions.
10 class C { 10 class C {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 private: 135 private:
136 // Okay to rename |isGarbageCollected| to |kIsGarbageCollected|. 136 // Okay to rename |isGarbageCollected| to |kIsGarbageCollected|.
137 static const bool isGarbageCollected = true; 137 static const bool isGarbageCollected = true;
138 138
139 public: 139 public:
140 // Expecting no rename of |value|. 140 // Expecting no rename of |value|.
141 static const LifetimeManagementType value = 141 static const LifetimeManagementType value =
142 !isGarbageCollected ? RefCountedLifetime : GarbageCollectedLifetime; 142 !isGarbageCollected ? RefCountedLifetime : GarbageCollectedLifetime;
143 }; 143 };
144 144
145 template <typename T>
146 struct GenericHashTraitsBase {
147 // We don't want to capitalize fields in type traits
148 // (i.e. the |value| -> |kValue| rename is undesirable below).
149 // This problem is prevented by IsCallee heuristic.
150 static const int kWeakHandlingFlag = TypeTrait2<T>::value ? 123 : 456;
151 };
152
145 }; // namespace WTF 153 }; // namespace WTF
146 154
147 void F() { 155 void F() {
148 // Test that references to a static field are correctly rewritten. 156 // Test that references to a static field are correctly rewritten.
149 blink::C::instanceCount++; 157 blink::C::instanceCount++;
150 // Force instantiation of a copy constructor for blink::C to make sure field 158 // Force instantiation of a copy constructor for blink::C to make sure field
151 // initializers for synthesized functions don't cause weird rewrites. 159 // initializers for synthesized functions don't cause weird rewrites.
152 blink::C c; 160 blink::C c;
153 blink::C c2 = c; 161 blink::C c2 = c;
154 162
155 bool b1 = WTF::TypeTrait1::value; 163 bool b1 = WTF::TypeTrait1::value;
156 bool b2 = WTF::TypeTrait2<void>::value; 164 bool b2 = WTF::TypeTrait2<void>::value;
157 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698