C++: fix inconsistency with global var constructor

This commit is contained in:
Robert Marsh
2022-03-30 13:32:02 -04:00
parent 9d4aac61fd
commit fb0a848e5a
10 changed files with 28 additions and 51 deletions

View File

@@ -49,6 +49,9 @@ class Expr extends StmtParent, @expr {
/** Gets the enclosing variable of this expression, if any. */
Variable getEnclosingVariable() { result = exprEnclosingElement(this) }
/** Gets the enclosing variable or function of this expression. */
Declaration getEnclosingDeclaration() { result = exprEnclosingElement(this) }
/** Gets a child of this expression. */
Expr getAChild() { exists(int n | result = this.getChild(n)) }