We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e319c17 commit 1cdaaf7Copy full SHA for 1cdaaf7
1 file changed
cpp/ql/src/Best Practices/Unused Entities/UnusedStaticFunctions.ql
@@ -13,6 +13,12 @@
13
14
import cpp
15
16
+predicate possiblyIncompleteFile(File f) {
17
+ exists(Diagnostic d | d.getFile() = f and d.getSeverity() >= 3)
18
+ or
19
+ exists(ErrorExpr ee | ee.getFile() = f)
20
+}
21
+
22
predicate immediatelyReachableFunction(Function f) {
23
not f.isStatic()
24
or
@@ -33,9 +39,7 @@ predicate immediatelyReachableFunction(Function f) {
33
39
f.getAnAttribute().hasName("unused")
34
40
35
41
// a compiler error in the same file suggests we may be missing data
36
- exists(Diagnostic d | d.getFile() = f.getFile() and d.getSeverity() >= 3)
37
- or
38
- exists(ErrorExpr ee | ee.getFile() = f.getFile())
42
+ possiblyIncompleteFile(f.getFile())
43
}
44
45
predicate immediatelyReachableVariable(Variable v) {
0 commit comments