| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 class TypeTrait2 { | 84 class TypeTrait2 { |
| 85 public: | 85 public: |
| 86 static const bool value = false; | 86 static const bool value = false; |
| 87 }; | 87 }; |
| 88 template <> | 88 template <> |
| 89 class TypeTrait2<void> { | 89 class TypeTrait2<void> { |
| 90 public: | 90 public: |
| 91 static const bool value = false; | 91 static const bool value = false; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 // We don't want to rewrite fields in type traits |
| 95 // (i.e. the |Value| -> |kValue| rename is undesirable below). |
| 96 struct TypeTrait3 { |
| 97 static const bool Value = true; |
| 98 }; |
| 99 |
| 94 // Some type traits have static methods. We should not perform | 100 // Some type traits have static methods. We should not perform |
| 95 // a |value| -> |kValue| rename in the type trait below. | 101 // a |value| -> |kValue| rename in the type trait below. |
| 96 template <typename T, typename U> | 102 template <typename T, typename U> |
| 97 struct IsSubclass { | 103 struct IsSubclass { |
| 98 private: | 104 private: |
| 99 typedef char YesType; | 105 typedef char YesType; |
| 100 struct NoType { | 106 struct NoType { |
| 101 char padding[8]; | 107 char padding[8]; |
| 102 }; | 108 }; |
| 103 | 109 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Test that references to a static field are correctly rewritten. | 154 // Test that references to a static field are correctly rewritten. |
| 149 blink::C::instanceCount++; | 155 blink::C::instanceCount++; |
| 150 // Force instantiation of a copy constructor for blink::C to make sure field | 156 // Force instantiation of a copy constructor for blink::C to make sure field |
| 151 // initializers for synthesized functions don't cause weird rewrites. | 157 // initializers for synthesized functions don't cause weird rewrites. |
| 152 blink::C c; | 158 blink::C c; |
| 153 blink::C c2 = c; | 159 blink::C c2 = c; |
| 154 | 160 |
| 155 bool b1 = WTF::TypeTrait1::value; | 161 bool b1 = WTF::TypeTrait1::value; |
| 156 bool b2 = WTF::TypeTrait2<void>::value; | 162 bool b2 = WTF::TypeTrait2<void>::value; |
| 157 } | 163 } |
| OLD | NEW |