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* bar() { |
| 15 return nullptr; |
| 16 } |
| 17 |
| 18 } // namespace |
| 19 |
7 // Tests that the prototype for a function is updated. | 20 // Tests that the prototype for a function is updated. |
8 int testFunctionThatTakesTwoInts(int x, int y); | 21 int testFunctionThatTakesTwoInts(int x, int y); |
9 // Overload to test using declarations that introduce multiple shadow | 22 // Overload to test using declarations that introduce multiple shadow |
10 // declarations. | 23 // declarations. |
11 int testFunctionThatTakesTwoInts(int x, int y, int z); | 24 int testFunctionThatTakesTwoInts(int x, int y, int z); |
12 | 25 |
13 // Test that the actual function definition is also updated. | 26 // Test that the actual function definition is also updated. |
14 int testFunctionThatTakesTwoInts(int x, int y) { | 27 int testFunctionThatTakesTwoInts(int x, int y) { |
15 if (x == 0) | 28 if (x == 0) |
16 return y; | 29 return y; |
(...skipping 29 matching lines...) Expand all Loading... |
46 } | 59 } |
47 | 60 |
48 using blink::testFunctionThatTakesTwoInts; | 61 using blink::testFunctionThatTakesTwoInts; |
49 | 62 |
50 void G() { | 63 void G() { |
51 testFunctionThatTakesTwoInts(1, 2); | 64 testFunctionThatTakesTwoInts(1, 2); |
52 | 65 |
53 blink::SwapType a, b; | 66 blink::SwapType a, b; |
54 swap(a, b); | 67 swap(a, b); |
55 } | 68 } |
OLD | NEW |