@@ -177,7 +177,10 @@ class ContainerInvalidationOperation extends FunctionCall {
177
177
]
178
178
)
179
179
or
180
- this .getTarget ( ) .hasGlobalOrStdName ( [ "swap" , "operator>>" , "getline" ] )
180
+ exists ( FunctionCall fc |
181
+ fc .getTarget ( ) .getNamespace ( ) instanceof StdNS and
182
+ this .getTarget ( ) .getName ( ) in [ "swap" , "operator>>" , "getline" ]
183
+ )
181
184
)
182
185
)
183
186
}
@@ -252,11 +255,16 @@ class AdditiveOperatorFunctionCall extends FunctionCall {
252
255
*/
253
256
class STLContainer extends Class {
254
257
STLContainer ( ) {
255
- this .hasGlobalOrStdName ( [
258
+ getNamespace ( ) instanceof StdNS and
259
+ getSimpleName ( ) in [
256
260
"vector" , "list" , "deque" , "set" , "multiset" , "map" , "multimap" , "stack" , "queue" ,
257
261
"priority_queue" , "string" , "forward_list" , "unordered_set" , "unordered_multiset" ,
258
262
"unordered_map" , "unordered_multimap" , "valarray" , "string" , "basic_string"
259
- ] )
263
+ ]
264
+ or
265
+ getSimpleName ( ) = "string"
266
+ or
267
+ getSimpleName ( ) = "basic_string"
260
268
}
261
269
262
270
/**
@@ -291,7 +299,7 @@ class STLContainer extends Class {
291
299
IteratorSource getAConstIteratorEndFunctionCall ( ) { result = getACallTo ( "cend" ) }
292
300
293
301
IteratorSource getANonConstIteratorFunctionCall ( ) {
294
- // result = this. getACallToAFunction() and
302
+ result = getACallToAFunction ( ) and
295
303
result .getTarget ( ) .getType ( ) instanceof NonConstIteratorType
296
304
}
297
305
@@ -343,24 +351,24 @@ class STLContainerVariable extends Variable {
343
351
* to create this functionality.
344
352
*/
345
353
class IteratorRangeModel extends Function {
346
- IteratorRangeModel ( ) { this . hasGlobalOrStdName ( "lexicographical_compare" ) }
354
+ IteratorRangeModel ( ) { hasQualifiedName ( "std" , "lexicographical_compare" ) }
347
355
348
356
int getAnIndexOfAStartRange ( ) {
349
- ( this . hasGlobalOrStdName ( "lexicographical_compare" ) and result = [ 0 , 1 ] )
357
+ ( hasQualifiedName ( "std" , "lexicographical_compare" ) and result = [ 0 , 1 ] )
350
358
}
351
359
352
360
int getAnIndexOfAEndRange ( ) {
353
- ( this . hasGlobalOrStdName ( "lexicographical_compare" ) and result = [ 2 , 3 ] )
361
+ ( hasQualifiedName ( "std" , "lexicographical_compare" ) and result = [ 2 , 3 ] )
354
362
}
355
363
356
364
int getAnIteratorArgumentIndex ( ) {
357
- ( this . hasGlobalOrStdName ( "lexicographical_compare" ) and result = [ 0 , 1 , 2 , 3 ] )
365
+ ( hasQualifiedName ( "std" , "lexicographical_compare" ) and result = [ 0 , 1 , 2 , 3 ] )
358
366
}
359
367
360
368
predicate getAPairOfStartEndIndexes ( int start , int end ) {
361
- this . hasGlobalOrStdName ( "lexicographical_compare" ) and start = 0 and end = 1
369
+ hasQualifiedName ( "std" , "lexicographical_compare" ) and start = 0 and end = 1
362
370
or
363
- this . hasGlobalOrStdName ( "lexicographical_compare" ) and start = 2 and end = 3
371
+ hasQualifiedName ( "std" , "lexicographical_compare" ) and start = 2 and end = 3
364
372
}
365
373
}
366
374
0 commit comments