Skip to content

Commit fb919d6

Browse files
committed
C++: Add test to check lambda parameters emptyness
1 parent ec16b0b commit fb919d6

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
| parameters.cpp:8:5:8:20 | [...](...){...} |
2+
| parameters.cpp:10:5:10:26 | [...](...){...} |
3+
| parameters.cpp:13:5:13:20 | [...](...){...} |
4+
| parameters.cpp:16:5:18:5 | [...](...){...} |
5+
| parameters.cpp:25:5:25:14 | [...](...){...} |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import cpp
2+
3+
from LambdaExpression e
4+
where e.emptyParameterListIsExplicit()
5+
select e
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
void test_lambda_declarator() {
2+
[=](int, float) { };
3+
4+
[](int x = 42) { };
5+
6+
[](int x) { };
7+
8+
[]() mutable { };
9+
10+
[]() [[nodiscard]] { };
11+
[] [[nodiscard]] { };
12+
13+
[]() -> void { };
14+
15+
int i;
16+
[&i]() {
17+
i += 1;
18+
};
19+
20+
[&i] {
21+
i += 1;
22+
};
23+
24+
[] { };
25+
[=] () { };
26+
}

0 commit comments

Comments
 (0)