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 namespace { |
| 8 |
| 9 // Naive renaming will break the build, by leaving return type the same name as |
| 10 // the function name - to avoid this "Get" prefix needs to be prepended as |
| 11 // suggested in https://crbug.com/582312#c17. |
| 12 class Foo582312 {}; |
| 13 using Bar = Foo582312; |
| 14 static Bar* GetBar() { |
| 15 return nullptr; |
| 16 } |
| 17 } |
| 18 |
7 // Tests that the prototype for a function is updated. | 19 // Tests that the prototype for a function is updated. |
8 int TestFunctionThatTakesTwoInts(int x, int y); | 20 int TestFunctionThatTakesTwoInts(int x, int y); |
9 // Overload to test using declarations that introduce multiple shadow | 21 // Overload to test using declarations that introduce multiple shadow |
10 // declarations. | 22 // declarations. |
11 int TestFunctionThatTakesTwoInts(int x, int y, int z); | 23 int TestFunctionThatTakesTwoInts(int x, int y, int z); |
12 | 24 |
13 // Test that the actual function definition is also updated. | 25 // Test that the actual function definition is also updated. |
14 int TestFunctionThatTakesTwoInts(int x, int y) { | 26 int TestFunctionThatTakesTwoInts(int x, int y) { |
15 if (x == 0) | 27 if (x == 0) |
16 return y; | 28 return y; |
(...skipping 29 matching lines...) Expand all Loading... |
46 } | 58 } |
47 | 59 |
48 using blink::TestFunctionThatTakesTwoInts; | 60 using blink::TestFunctionThatTakesTwoInts; |
49 | 61 |
50 void G() { | 62 void G() { |
51 TestFunctionThatTakesTwoInts(1, 2); | 63 TestFunctionThatTakesTwoInts(1, 2); |
52 | 64 |
53 blink::SwapType a, b; | 65 blink::SwapType a, b; |
54 swap(a, b); | 66 swap(a, b); |
55 } | 67 } |
OLD | NEW |