@@ -49,6 +49,11 @@ class PotentiallyUnusedLocalVariable extends LocalVariable {
4949 // Ignore functions with error expressions as they indicate expressions that the extractor couldn't process
5050 not any ( ErrorExpr e ) .getEnclosingFunction ( ) = f
5151 )
52+ // ) and
53+ // // exclude uninstantiated template members
54+ // not this.isFromUninstantiatedTemplate(_) and
55+ // // Do not report compiler generated variables
56+ // not this.isCompilerGenerated()
5257 }
5358}
5459
@@ -95,7 +100,9 @@ class PotentiallyUnusedMemberVariable extends MemberVariable {
95100 // Lambda captures are not "real" member variables - it's an implementation detail that they are represented that way
96101 not this = any ( LambdaCapture lc ) .getField ( ) and
97102 // exclude uninstantiated template members
98- not this .isFromUninstantiatedTemplate ( _)
103+ not this .isFromUninstantiatedTemplate ( _) and
104+ // Do not report compiler generated variables
105+ not this .isCompilerGenerated ( )
99106 }
100107}
101108
@@ -107,7 +114,11 @@ class PotentiallyUnusedGlobalOrNamespaceVariable extends GlobalOrNamespaceVariab
107114 // Not declared in a macro expansion
108115 not isInMacroExpansion ( ) and
109116 // 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 ( )
111122 }
112123}
113124
0 commit comments