File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
cpp/ql/src/Best Practices/Unused Entities Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ predicate reachableThing(Thing t) {
50
50
exists ( Thing mid | reachableThing ( mid ) and mid .callsOrAccesses ( ) = t )
51
51
}
52
52
53
+ pragma [ nomagic]
54
+ predicate callsOrAccessesPlus ( Thing thing1 , FunctionToRemove thing2 ) {
55
+ thing1 .callsOrAccesses ( ) = thing2
56
+ or
57
+ exists ( Thing mid |
58
+ thing1 .callsOrAccesses ( ) = mid and
59
+ callsOrAccessesPlus ( mid , thing2 )
60
+ )
61
+ }
62
+
53
63
class Thing extends Locatable {
54
64
Thing ( ) {
55
65
this instanceof Function or
@@ -81,7 +91,7 @@ class FunctionToRemove extends Function {
81
91
}
82
92
83
93
Thing getOther ( ) {
84
- result . callsOrAccesses + ( ) = this and
94
+ callsOrAccessesPlus ( result , this ) and
85
95
this != result and
86
96
// We will already be reporting the enclosing function of a
87
97
// local variable, so don't also report the variable
You can’t perform that action at this time.
0 commit comments