Skip to content

Commit d94a779

Browse files
committed
C++: Add test to check lambda parameters emptyness
1 parent 81e8151 commit d94a779

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
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)