@@ -28,6 +28,8 @@ private import semmle.code.cpp.internal.ResolveClass
2828 * can have multiple declarations.
2929 */
3030class Variable extends Declaration , @variable {
31+ override string getCanonicalQLClass ( ) { result = "Variable" }
32+
3133 /** Gets the initializer of this variable, if any. */
3234 Initializer getInitializer ( ) { result .getDeclaration ( ) = this }
3335
@@ -351,6 +353,8 @@ class StackVariable extends LocalScopeVariable {
351353 * A local variable can be declared by a `DeclStmt` or a `ConditionDeclExpr`.
352354 */
353355class LocalVariable extends LocalScopeVariable , @localvariable {
356+ override string getCanonicalQLClass ( ) { result = "LocalVariable" }
357+
354358 override string getName ( ) { localvariables ( underlyingElement ( this ) , _, result ) }
355359
356360 override Type getType ( ) { localvariables ( underlyingElement ( this ) , unresolveElement ( result ) , _) }
@@ -396,6 +400,8 @@ class NamespaceVariable extends GlobalOrNamespaceVariable {
396400 NamespaceVariable ( ) {
397401 exists ( Namespace n | namespacembrs ( unresolveElement ( n ) , underlyingElement ( this ) ) )
398402 }
403+
404+ override string getCanonicalQLClass ( ) { result = "NamespaceVariable" }
399405}
400406
401407/**
@@ -415,6 +421,8 @@ class NamespaceVariable extends GlobalOrNamespaceVariable {
415421 */
416422class GlobalVariable extends GlobalOrNamespaceVariable {
417423 GlobalVariable ( ) { not this instanceof NamespaceVariable }
424+
425+ override string getCanonicalQLClass ( ) { result = "GlobalVariable" }
418426}
419427
420428/**
@@ -434,6 +442,8 @@ class GlobalVariable extends GlobalOrNamespaceVariable {
434442class MemberVariable extends Variable , @membervariable {
435443 MemberVariable ( ) { this .isMember ( ) }
436444
445+ override string getCanonicalQLClass ( ) { result = "MemberVariable" }
446+
437447 /** Holds if this member is private. */
438448 predicate isPrivate ( ) { this .hasSpecifier ( "private" ) }
439449
0 commit comments