Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 class TypeTrait2 { | 87 class TypeTrait2 { |
| 88 public: | 88 public: |
| 89 static const bool value = false; | 89 static const bool value = false; |
| 90 }; | 90 }; |
| 91 template <> | 91 template <> |
| 92 class TypeTrait2<void> { | 92 class TypeTrait2<void> { |
| 93 public: | 93 public: |
| 94 static const bool value = false; | 94 static const bool value = false; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 // We don't want to rewrite fields in type traits | |
| 98 // (i.e. the |Value| -> |kValue| rename is undesirable below). | |
| 99 struct TypeTrait3 { | |
| 100 static const bool Value = true; | |
|
danakj
2016/09/09 00:07:40
shouldn't it be |value| ?
danakj
2016/09/09 00:08:31
Maybe we should just change these to lowercase up
Łukasz Anforowicz
2016/09/09 16:55:46
Good point. I've tried to look for other cases of
| |
| 101 }; | |
| 102 | |
| 97 // Some type traits have static methods. We should not perform | 103 // Some type traits have static methods. We should not perform |
| 98 // a |value| -> |kValue| rename in the type trait below. | 104 // a |value| -> |kValue| rename in the type trait below. |
| 99 template <typename T, typename U> | 105 template <typename T, typename U> |
| 100 struct IsSubclass { | 106 struct IsSubclass { |
| 101 private: | 107 private: |
| 102 typedef char YesType; | 108 typedef char YesType; |
| 103 struct NoType { | 109 struct NoType { |
| 104 char padding[8]; | 110 char padding[8]; |
| 105 }; | 111 }; |
| 106 | 112 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 // Test that references to a static field are correctly rewritten. | 157 // Test that references to a static field are correctly rewritten. |
| 152 blink::C::instance_count_++; | 158 blink::C::instance_count_++; |
| 153 // Force instantiation of a copy constructor for blink::C to make sure field | 159 // Force instantiation of a copy constructor for blink::C to make sure field |
| 154 // initializers for synthesized functions don't cause weird rewrites. | 160 // initializers for synthesized functions don't cause weird rewrites. |
| 155 blink::C c; | 161 blink::C c; |
| 156 blink::C c2 = c; | 162 blink::C c2 = c; |
| 157 | 163 |
| 158 bool b1 = WTF::TypeTrait1::value; | 164 bool b1 = WTF::TypeTrait1::value; |
| 159 bool b2 = WTF::TypeTrait2<void>::value; | 165 bool b2 = WTF::TypeTrait2<void>::value; |
| 160 } | 166 } |
| OLD | NEW |