File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
cpp/ql/src/Best Practices/Unused Entities Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1313
1414import cpp
1515
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+
1622predicate immediatelyReachableFunction ( Function f ) {
1723 not f .isStatic ( )
1824 or
@@ -33,9 +39,7 @@ predicate immediatelyReachableFunction(Function f) {
3339 f .getAnAttribute ( ) .hasName ( "unused" )
3440 or
3541 // 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 ( ) )
3943}
4044
4145predicate immediatelyReachableVariable ( Variable v ) {
You can’t perform that action at this time.
0 commit comments