Skip to content

Commit 1800e36

Browse files
geoffw0Mariusz Kliber
authored andcommitted
C++: Add two more test cases.
1 parent 20db437 commit 1800e36

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cpp/ql/test/query-tests/Best Practices/Unused Entities/UnusedStaticFunctions/unused_static_functions.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,16 @@ static void f6(void);
3333
static void f5(void) { f6(); }
3434
static void f6(void) { f5(); }
3535

36+
// f7 and f8 are reachable from `function_caller`
37+
static int f7() { return 1; } // GOOD
38+
static void f8() { } // GOOD
39+
40+
void function_caller()
41+
{
42+
auto my_lambda = []() {
43+
return f7();
44+
}();
45+
46+
f8();
47+
}
48+

0 commit comments

Comments
 (0)