Merge pull request #10112 from jketema/orphaned

C++: Handle orphaned local variables
This commit is contained in:
Jeroen Ketema
2022-08-22 10:45:10 +02:00
committed by GitHub
16 changed files with 8845 additions and 191 deletions

View File

@@ -398,6 +398,8 @@ class LocalVariable extends LocalScopeVariable, @localvariable {
exists(DeclStmt s | s.getADeclaration() = this and s.getEnclosingFunction() = result)
or
exists(ConditionDeclExpr e | e.getVariable() = this and e.getEnclosingFunction() = result)
or
orphaned_variables(underlyingElement(this), unresolveElement(result))
}
}