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 // Tests that the prototype for a function is updated. | 7 // Tests that the prototype for a function is updated. |
8 int TestFunctionThatTakesTwoInts(int x, int y); | 8 int TestFunctionThatTakesTwoInts(int x, int y); |
9 | 9 |
10 // Test that the actual function definition is also updated. | 10 // Test that the actual function definition is also updated. |
11 int TestFunctionThatTakesTwoInts(int x, int y) { | 11 int TestFunctionThatTakesTwoInts(int x, int y) { |
12 if (x == 0) | 12 if (x == 0) |
13 return y; | 13 return y; |
14 // Calls to the function also need to be updated. | 14 // Calls to the function also need to be updated. |
15 return TestFunctionThatTakesTwoInts(x - 1, y + 1); | 15 return TestFunctionThatTakesTwoInts(x - 1, y + 1); |
16 } | 16 } |
17 | 17 |
18 // Note: F is already Google style and should not change. | 18 // Note: F is already Google style and should not change. |
19 void F() { | 19 void F() { |
20 // Test referencing a function without calling it. | 20 // Test referencing a function without calling it. |
21 int (*function_pointer)(int, int) = &TestFunctionThatTakesTwoInts; | 21 int (*function_pointer)(int, int) = &TestFunctionThatTakesTwoInts; |
22 } | 22 } |
23 | 23 |
24 } // namespace blink | 24 } // namespace blink |
25 | |
26 void G() { | |
27 TestFunctionThatTakesTwoInts::TestFunctionThatTakesTwoInts(1, 2); | |
danakj
2016/01/06 22:09:40
this did the wrong thing? why not blink::TestFunct
dcheng
2016/01/08 01:41:11
So it turns out that a CallExpr wraps a callee exp
| |
28 } | |
OLD | NEW |