CPP: Another test case.

This commit is contained in:
Geoffrey White
2019-08-05 18:47:44 +01:00
parent 19a0d4697e
commit 6462da736b
3 changed files with 81 additions and 0 deletions

View File

@@ -17,3 +17,11 @@ struct foo {
};
}
};
int d(int x, int y) {
auto myLambda = [&, x](int z) -> int {
return x + y + z;
};
return myLambda(1000);
}

View File

@@ -3,4 +3,6 @@
| captures.cpp:10:7:10:7 | (captured this) | implicit | 0 | (captured this) | this |
| captures.cpp:10:9:10:9 | x | implicit | 1 | x | x |
| captures.cpp:15:6:15:6 | x | explicit | 0 | x | x |
| captures.cpp:22:23:22:23 | x | explicit | 0 | x | x |
| captures.cpp:23:16:23:16 | y | implicit | 1 | y | y |
| end_pos.cpp:9:17:9:18 | ii | explicit | 0 | ii | ii |

View File

@@ -93,6 +93,53 @@
| captures.cpp:16:13:16:49 | // `x` is unused, but still captured. |
| captures.cpp:17:5:17:5 | return ... |
| captures.cpp:18:3:18:3 | return ... |
| captures.cpp:21:5:21:5 | d |
| captures.cpp:21:5:21:5 | definition of d |
| captures.cpp:21:11:21:11 | definition of x |
| captures.cpp:21:11:21:11 | x |
| captures.cpp:21:18:21:18 | definition of y |
| captures.cpp:21:18:21:18 | y |
| captures.cpp:21:21:27:1 | { ... } |
| captures.cpp:22:3:24:4 | declaration |
| captures.cpp:22:8:22:15 | definition of myLambda |
| captures.cpp:22:8:22:15 | myLambda |
| captures.cpp:22:18:24:3 | initializer for myLambda |
| captures.cpp:22:19:22:19 | (constructor) |
| captures.cpp:22:19:22:19 | (constructor) |
| captures.cpp:22:19:22:19 | (constructor) |
| captures.cpp:22:19:22:19 | Unknown literal |
| captures.cpp:22:19:22:19 | Unknown literal |
| captures.cpp:22:19:22:19 | constructor init of field x |
| captures.cpp:22:19:22:19 | constructor init of field y |
| captures.cpp:22:19:22:19 | declaration of (null) |
| captures.cpp:22:19:22:19 | definition of (null) |
| captures.cpp:22:19:22:19 | definition of (null) |
| captures.cpp:22:19:22:19 | definition of operator= |
| captures.cpp:22:19:22:19 | operator= |
| captures.cpp:22:19:22:19 | return ... |
| captures.cpp:22:19:22:19 | { ... } |
| captures.cpp:22:19:24:3 | [...](...){...} |
| captures.cpp:22:19:24:3 | {...} |
| captures.cpp:22:23:22:23 | definition of x |
| captures.cpp:22:23:22:23 | x |
| captures.cpp:22:23:22:23 | x |
| captures.cpp:22:25:22:25 | definition of operator() |
| captures.cpp:22:25:22:25 | operator() |
| captures.cpp:22:30:22:30 | definition of z |
| captures.cpp:22:30:22:30 | z |
| captures.cpp:22:40:24:3 | { ... } |
| captures.cpp:23:5:23:21 | return ... |
| captures.cpp:23:12:23:16 | ... + ... |
| captures.cpp:23:12:23:20 | ... + ... |
| captures.cpp:23:16:23:16 | (reference dereference) |
| captures.cpp:23:16:23:16 | definition of y |
| captures.cpp:23:16:23:16 | y |
| captures.cpp:23:20:23:20 | z |
| captures.cpp:26:3:26:24 | return ... |
| captures.cpp:26:10:26:17 | (const lambda [] type at line 22, col. 19)... |
| captures.cpp:26:10:26:17 | myLambda |
| captures.cpp:26:18:26:18 | call to operator() |
| captures.cpp:26:19:26:22 | 1000 |
| end_pos.cpp:0:0:0:0 | end_pos.cpp |
| end_pos.cpp:2:1:2:14 | #define OPEN { |
| end_pos.cpp:3:6:3:10 | definition of igFun |
@@ -139,8 +186,13 @@
| file://:0:0:0:0 | (captured this) |
| file://:0:0:0:0 | (captured this) |
| file://:0:0:0:0 | (global namespace) |
| file://:0:0:0:0 | (reference to) |
| file://:0:0:0:0 | ..()(..) |
| file://:0:0:0:0 | ..()(..) |
| file://:0:0:0:0 | ..(*)(..) |
| file://:0:0:0:0 | ..(*)(..) |
| file://:0:0:0:0 | ..(*)(..) |
| file://:0:0:0:0 | ..(..) |
| file://:0:0:0:0 | __va_list_tag |
| file://:0:0:0:0 | __va_list_tag & |
| file://:0:0:0:0 | __va_list_tag && |
@@ -161,6 +213,10 @@
| file://:0:0:0:0 | const lambda [] type at line 9, col. 15 & |
| file://:0:0:0:0 | const lambda [] type at line 15, col. 5 |
| file://:0:0:0:0 | const lambda [] type at line 15, col. 5 & |
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 |
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 & |
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 * |
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 *const |
| file://:0:0:0:0 | declaration of 1st parameter |
| file://:0:0:0:0 | declaration of 1st parameter |
| file://:0:0:0:0 | declaration of 1st parameter |
@@ -175,6 +231,10 @@
| file://:0:0:0:0 | declaration of 1st parameter |
| file://:0:0:0:0 | declaration of 1st parameter |
| file://:0:0:0:0 | declaration of 1st parameter |
| file://:0:0:0:0 | declaration of 1st parameter |
| file://:0:0:0:0 | declaration of 1st parameter |
| file://:0:0:0:0 | declaration of 1st parameter |
| file://:0:0:0:0 | decltype([...](...){...}) |
| file://:0:0:0:0 | decltype([...](...){...}) |
| file://:0:0:0:0 | decltype([...](...){...}) |
| file://:0:0:0:0 | decltype([...](...){...}) |
@@ -200,6 +260,9 @@
| file://:0:0:0:0 | lambda [] type at line 9, col. 15 && |
| file://:0:0:0:0 | lambda [] type at line 15, col. 5 & |
| file://:0:0:0:0 | lambda [] type at line 15, col. 5 && |
| file://:0:0:0:0 | lambda [] type at line 22, col. 19 & |
| file://:0:0:0:0 | lambda [] type at line 22, col. 19 && |
| file://:0:0:0:0 | lambda [] type at line 22, col. 19 * |
| file://:0:0:0:0 | operator= |
| file://:0:0:0:0 | operator= |
| file://:0:0:0:0 | overflow_arg_area |
@@ -219,13 +282,21 @@
| file://:0:0:0:0 | p#0 |
| file://:0:0:0:0 | p#0 |
| file://:0:0:0:0 | p#0 |
| file://:0:0:0:0 | p#0 |
| file://:0:0:0:0 | p#0 |
| file://:0:0:0:0 | p#0 |
| file://:0:0:0:0 | reg_save_area |
| file://:0:0:0:0 | this |
| file://:0:0:0:0 | this |
| file://:0:0:0:0 | this |
| file://:0:0:0:0 | this |
| file://:0:0:0:0 | this |
| file://:0:0:0:0 | this |
| file://:0:0:0:0 | this |
| file://:0:0:0:0 | void * |
| file://:0:0:0:0 | x |
| file://:0:0:0:0 | x |
| file://:0:0:0:0 | x |
| file://:0:0:0:0 | x |
| file://:0:0:0:0 | y |
| file://:0:0:0:0 | y |