@@ -49,6 +49,11 @@ class PotentiallyUnusedLocalVariable extends LocalVariable {
49
49
// Ignore functions with error expressions as they indicate expressions that the extractor couldn't process
50
50
not any ( ErrorExpr e ) .getEnclosingFunction ( ) = f
51
51
)
52
+ // ) and
53
+ // // exclude uninstantiated template members
54
+ // not this.isFromUninstantiatedTemplate(_) and
55
+ // // Do not report compiler generated variables
56
+ // not this.isCompilerGenerated()
52
57
}
53
58
}
54
59
@@ -95,7 +100,9 @@ class PotentiallyUnusedMemberVariable extends MemberVariable {
95
100
// Lambda captures are not "real" member variables - it's an implementation detail that they are represented that way
96
101
not this = any ( LambdaCapture lc ) .getField ( ) and
97
102
// exclude uninstantiated template members
98
- not this .isFromUninstantiatedTemplate ( _)
103
+ not this .isFromUninstantiatedTemplate ( _) and
104
+ // Do not report compiler generated variables
105
+ not this .isCompilerGenerated ( )
99
106
}
100
107
}
101
108
@@ -107,7 +114,11 @@ class PotentiallyUnusedGlobalOrNamespaceVariable extends GlobalOrNamespaceVariab
107
114
// Not declared in a macro expansion
108
115
not isInMacroExpansion ( ) and
109
116
// No side-effects from declaration
110
- not declarationHasSideEffects ( this )
117
+ not declarationHasSideEffects ( this ) and
118
+ // exclude uninstantiated template members
119
+ not this .isFromUninstantiatedTemplate ( _) and
120
+ // Do not report compiler generated variables
121
+ not this .isCompilerGenerated ( )
111
122
}
112
123
}
113
124
0 commit comments