Skip to content

Commit 2aa6ff6

Browse files
committed
C++: Add comments about the temporary exclusions.
1 parent 0790fb6 commit 2aa6ff6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ 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(Literal l |
61+
not exists(Literal l | // this case can be removed when the `myFunction2( [obj](){} );` test case doesn't depend on this exclusion
6262
l.getEnclosingFunction() = f and
6363
not exists(l.getValue())
6464
) and
65-
not any(ConditionDeclExpr cde).getEnclosingFunction() = f
65+
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
6666
select v, "Variable " + v.getName() + " is not used"

0 commit comments

Comments
 (0)