mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
C++: Work around issue with 'Unknown literal'.
This commit is contained in:
@@ -57,5 +57,9 @@ where
|
||||
not declarationHasSideEffects(v) and
|
||||
not exists(AsmStmt s | f = s.getEnclosingFunction()) and
|
||||
not v.getAnAttribute().getName() = "unused" and
|
||||
not any(ErrorExpr e).getEnclosingFunction() = f // unextracted expr likely used `v`
|
||||
not any(ErrorExpr e).getEnclosingFunction() = f and // unextracted expr may use `v`
|
||||
not exists(Literal l |
|
||||
l.getEnclosingFunction() = f and
|
||||
not exists(l.getValue())
|
||||
)
|
||||
select v, "Variable " + v.getName() + " is not used"
|
||||
|
||||
Reference in New Issue
Block a user