Skip to content

Commit 4f49f9d

Browse files
committed
C++: Remove exception from cpp/unused-local-variable that is no longer needed
1 parent 3fed59f commit 4f49f9d

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,5 @@ where
5858
not exists(AsmStmt s | f = s.getEnclosingFunction()) and
5959
not v.getAnAttribute().getName() = "unused" and
6060
not any(ErrorExpr e).getEnclosingFunction() = f and // unextracted expr may use `v`
61-
not exists(
62-
Literal l // this case can be removed when the `myFunction2( [obj](){} );` test case doesn't depend on this exclusion
63-
|
64-
l.getEnclosingFunction() = f and
65-
not exists(l.getValue())
66-
) and
6761
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
6862
select v, "Variable " + v.getName() + " is not used"

0 commit comments

Comments
 (0)