mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
28 lines
351 B
C++
28 lines
351 B
C++
struct foo {
|
|
void a(int x) {
|
|
[x, this] {
|
|
a(x + 1);
|
|
};
|
|
}
|
|
|
|
void b(int x) {
|
|
[=] {
|
|
b(x + 1);
|
|
};
|
|
}
|
|
|
|
static void c(int x) {
|
|
[x] {
|
|
c(0); // `x` is unused, but still captured.
|
|
};
|
|
}
|
|
};
|
|
|
|
int d(int x, int y) {
|
|
auto myLambda = [&, x](int z) -> int {
|
|
return x + y + z;
|
|
};
|
|
|
|
return myLambda(1000);
|
|
}
|