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 |
| 8 // break test coverage that we don't clobber the class name by trying to emit |
| 9 // replacements for synthesized functions. |
7 class C { | 10 class C { |
8 public: | 11 public: |
9 // Make sure initializers are updated to use the new names. | 12 // Make sure initializers are updated to use the new names. |
10 C() : flag_field_(~0), field_mentioning_http_and_https_(1) {} | 13 C() : flag_field_(~0), field_mentioning_http_and_https_(1) {} |
11 | 14 |
12 int Method() { | 15 int Method() { |
13 // Test that references to fields are updated correctly. | 16 // Test that references to fields are updated correctly. |
14 return instance_count_ + flag_field_ + field_mentioning_http_and_https_; | 17 return instance_count_ + flag_field_ + field_mentioning_http_and_https_; |
15 } | 18 } |
16 | 19 |
(...skipping 26 matching lines...) Expand all Loading... |
43 char fourChars[4]; | 46 char fourChars[4]; |
44 short twoShorts[2]; | 47 short twoShorts[2]; |
45 int one_hopefully_four_byte_int; | 48 int one_hopefully_four_byte_int; |
46 }; | 49 }; |
47 | 50 |
48 } // namespace blink | 51 } // namespace blink |
49 | 52 |
50 void F() { | 53 void F() { |
51 // Test that references to a static field are correctly rewritten. | 54 // Test that references to a static field are correctly rewritten. |
52 blink::C::instance_count_++; | 55 blink::C::instance_count_++; |
| 56 // Force instantiation of a copy constructor for blink::C to make sure field |
| 57 // initializers for synthesized functions don't cause weird rewrites. |
| 58 blink::C c; |
| 59 blink::C c2 = c; |
53 } | 60 } |
OLD | NEW |