@@ -82,7 +82,8 @@ private Locatable getATypeUse_i(Type type, string reason) {
82
82
// Ignore self referential variables and parameters
83
83
not v .getDeclaringType ( ) .refersTo ( type ) and
84
84
not type = v .( Parameter ) .getFunction ( ) .getDeclaringType ( )
85
- ) and reason = "used as a variable type"
85
+ ) and
86
+ reason = "used as a variable type"
86
87
or
87
88
// Used a function return type
88
89
exists ( Function f |
@@ -93,7 +94,8 @@ private Locatable getATypeUse_i(Type type, string reason) {
93
94
type = f .getType ( ) and reason = "used as a function return type"
94
95
or
95
96
type = f .getATemplateArgument ( ) and reason = "used as a function template argument"
96
- ) or
97
+ )
98
+ or
97
99
// Used either in a function call as a template argument, or as the declaring type
98
100
// of the function
99
101
exists ( FunctionCall fc | result = fc |
@@ -115,10 +117,12 @@ private Locatable getATypeUse_i(Type type, string reason) {
115
117
reason = "used in a sizeof expr"
116
118
or
117
119
// A use in a `Cast`
118
- exists ( Cast c | c = result | type = c .getType ( ) ) and reason = "used in a cast"
120
+ exists ( Cast c | c = result | type = c .getType ( ) ) and
121
+ reason = "used in a cast"
119
122
or
120
123
// Use of the type name in source
121
- exists ( TypeName t | t = result | type = t .getType ( ) ) and reason = "used in a typename"
124
+ exists ( TypeName t | t = result | type = t .getType ( ) ) and
125
+ reason = "used in a typename"
122
126
or
123
127
// Access of an enum constant
124
128
exists ( EnumConstantAccess eca | result = eca | type = eca .getTarget ( ) .getDeclaringEnum ( ) ) and
@@ -128,15 +132,17 @@ private Locatable getATypeUse_i(Type type, string reason) {
128
132
exists ( FieldAccess fa |
129
133
result = fa and
130
134
type = fa .getTarget ( ) .getDeclaringType ( )
131
- ) and reason = "used in a field access"
135
+ ) and
136
+ reason = "used in a field access"
132
137
or
133
138
// Name qualifiers
134
139
exists ( NameQualifier nq |
135
140
result = nq and
136
141
type = nq .getQualifyingElement ( )
137
- ) and reason = "used in name qualifier"
138
- // Temporary object creation of type `type`
142
+ ) and
143
+ reason = "used in name qualifier"
139
144
or
145
+ // Temporary object creation of type `type`
140
146
exists ( TemporaryObjectExpr toe | result = toe | type = toe .getType ( ) ) and
141
147
reason = "used in temporary object expr"
142
148
)
@@ -160,8 +166,8 @@ private Locatable getATypeUse_i(Type type, string reason) {
160
166
reason = "used in template class instantiation"
161
167
or
162
168
// This is a TemplateClass where one of the specializations is used
163
- type = used .( ClassTemplateSpecialization ) .getPrimaryTemplate ( )
164
- and reason = "used in template class specialization"
169
+ type = used .( ClassTemplateSpecialization ) .getPrimaryTemplate ( ) and
170
+ reason = "used in template class specialization"
165
171
or
166
172
// Alias templates - alias templates and instantiations are not properly captured by the
167
173
// extractor (last verified in CodeQL CLI 2.7.6). The only distinguishing factor is that
@@ -176,6 +182,7 @@ private Locatable getATypeUse_i(Type type, string reason) {
176
182
not exists ( instantiation .getLocation ( ) ) and
177
183
// Template and instantiation both have the same qualified name
178
184
template .getQualifiedName ( ) = instantiation .getQualifiedName ( )
179
- ) and reason = "used in alias template instantiation"
185
+ ) and
186
+ reason = "used in alias template instantiation"
180
187
)
181
188
}
0 commit comments