CodeQL library for C/C++
codeql/cpp-all 0.13.1 (changelog, source)

Member predicate Variable::getAnAssignment

Gets an assignment expression that assigns to this variable. For example: x=... or x+=....

This does not include the initialization of the variable. Use Variable.getInitializer() to get the variable’s initializer, or use Variable.getAnAssignedValue() to get an expression that is the right-hand side of an assignment or an initialization of the variable.

Assignment getAnAssignment()