mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
C++: Work around issue with ConditionalDeclExpr.
This commit is contained in:
@@ -61,5 +61,6 @@ where
|
||||
not exists(Literal l |
|
||||
l.getEnclosingFunction() = f and
|
||||
not exists(l.getValue())
|
||||
)
|
||||
) and
|
||||
not any(ConditionDeclExpr cde).getEnclosingFunction() = f
|
||||
select v, "Variable " + v.getName() + " is not used"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
| code2.cpp:64:7:64:8 | v3 | Variable v3 is not used |
|
||||
| code2.cpp:108:11:108:12 | v2 | Variable v2 is not used |
|
||||
| code2.cpp:128:9:128:9 | b | Variable b is not used |
|
||||
| code2.cpp:141:18:141:18 | b | Variable b is not used |
|
||||
| code.c:10:18:10:18 | y | Variable y is not used |
|
||||
| code.c:11:18:11:18 | z | Variable z is not used |
|
||||
| code.c:18:7:18:7 | x | Variable x is not used |
|
||||
|
||||
@@ -138,7 +138,7 @@ int test_lambdas2()
|
||||
|
||||
void test_if_initializer()
|
||||
{
|
||||
bool a = false, b = true; // GOOD: a, b are both used [FALSE POSITIVE]
|
||||
bool a = false, b = true; // GOOD: a, b are both used
|
||||
|
||||
if (a = b; a)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user