mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
C++: Remove exception from cpp/unused-local-variable that is no longer needed
This commit is contained in:
@@ -58,11 +58,5 @@ where
|
||||
not exists(AsmStmt s | f = s.getEnclosingFunction()) and
|
||||
not v.getAnAttribute().getName() = "unused" and
|
||||
not any(ErrorExpr e).getEnclosingFunction() = f and // unextracted expr may use `v`
|
||||
not exists(
|
||||
Literal l // this case can be removed when the `myFunction2( [obj](){} );` test case doesn't depend on this exclusion
|
||||
|
|
||||
l.getEnclosingFunction() = f and
|
||||
not exists(l.getValue())
|
||||
) and
|
||||
not any(ConditionDeclExpr cde).getEnclosingFunction() = f // this case can be removed when the `if (a = b; a)` test case doesn't depend on this exclusion
|
||||
select v, "Variable " + v.getName() + " is not used"
|
||||
|
||||
Reference in New Issue
Block a user