@@ -28,6 +28,8 @@ private import semmle.code.cpp.internal.ResolveClass
28
28
* can have multiple declarations.
29
29
*/
30
30
class Variable extends Declaration , @variable {
31
+ override string getCanonicalQLClass ( ) { result = "Variable" }
32
+
31
33
/** Gets the initializer of this variable, if any. */
32
34
Initializer getInitializer ( ) { result .getDeclaration ( ) = this }
33
35
@@ -351,6 +353,8 @@ class StackVariable extends LocalScopeVariable {
351
353
* A local variable can be declared by a `DeclStmt` or a `ConditionDeclExpr`.
352
354
*/
353
355
class LocalVariable extends LocalScopeVariable , @localvariable {
356
+ override string getCanonicalQLClass ( ) { result = "LocalVariable" }
357
+
354
358
override string getName ( ) { localvariables ( underlyingElement ( this ) , _, result ) }
355
359
356
360
override Type getType ( ) { localvariables ( underlyingElement ( this ) , unresolveElement ( result ) , _) }
@@ -396,6 +400,8 @@ class NamespaceVariable extends GlobalOrNamespaceVariable {
396
400
NamespaceVariable ( ) {
397
401
exists ( Namespace n | namespacembrs ( unresolveElement ( n ) , underlyingElement ( this ) ) )
398
402
}
403
+
404
+ override string getCanonicalQLClass ( ) { result = "NamespaceVariable" }
399
405
}
400
406
401
407
/**
@@ -415,6 +421,8 @@ class NamespaceVariable extends GlobalOrNamespaceVariable {
415
421
*/
416
422
class GlobalVariable extends GlobalOrNamespaceVariable {
417
423
GlobalVariable ( ) { not this instanceof NamespaceVariable }
424
+
425
+ override string getCanonicalQLClass ( ) { result = "GlobalVariable" }
418
426
}
419
427
420
428
/**
@@ -434,6 +442,8 @@ class GlobalVariable extends GlobalOrNamespaceVariable {
434
442
class MemberVariable extends Variable , @membervariable {
435
443
MemberVariable ( ) { this .isMember ( ) }
436
444
445
+ override string getCanonicalQLClass ( ) { result = "MemberVariable" }
446
+
437
447
/** Holds if this member is private. */
438
448
predicate isPrivate ( ) { this .hasSpecifier ( "private" ) }
439
449
0 commit comments