Module Variable

Import path

import semmle.code.cpp.Variable

Imports

Classes

FunctionPointerMemberVariable

A C/C++ function pointer member variable.

FunctionPointerVariable

A C/C++ function pointer variable.

GlobalOrNamespaceVariable

A C/C++ variable which has global scope or namespace scope. For example the variables a and b in the following code: ``` int a;

GlobalVariable

A C/C++ variable which has global scope. For example the variable a in the following code: ``` int a;

LocalScopeVariable

A C/C++ variable with block scope [N4140 3.3.3]. In other words, a local variable or a function parameter. For example, the variables a, b and c in the following code: void myFunction(int a) { int b; static int c; }

LocalVariable

A C/C++ local variable. In other words, any variable that has block scope [N4140 3.3.3], but is not a parameter of a Function or CatchBlock. For example the variables b and c in the following code: void myFunction(int a) { int b; static int c; }

MemberVariable

A C structure member or C++ member variable. For example the member variables m and s in the following code: class MyClass { public: int m; static int s; };

NamespaceVariable

A C/C++ variable which has namespace scope. For example the variable b in the following code: ``` int a;

ParameterDeclarationEntry

A parameter as described within a particular declaration or definition of a C/C++ function. For example the declaration of a in the following code: void myFunction(int a) { int b; }

SemanticStackVariable

A non-static local variable or parameter that is not part of an uninstantiated template. Uninstantiated templates are purely syntax, and only on instantiation will they be complete with information about types, conversions, call targets, etc. For example in the following code, the variables a in myFunction and b in the instantiation myTemplateFunction<int>, but not b in the template myTemplateFunction<T>: ``` void myFunction() { float a; }

StackVariable

A C/C++ variable with automatic storage duration. In other words, a function parameter or a local variable that is not static or thread-local. For example, the variables a and b in the following code. void myFunction(int a) { int b; static int c; }

StaticLocalVariable

A C++ local variable declared as static.

StaticStorageDurationVariable

A variable whose contents always have static storage duration. This can be a global variable, a namespace variable, a static local variable, or a static member variable.

TemplateVariable

A C++14 variable template. For example, in the following code the variable template v defines a family of variables: template<class T> T v;

Variable

A C/C++ variable. For example, in the following code there are four variables, a, b, c and d: ``` extern int a; int a;

VariableDeclarationEntry

A particular declaration or definition of a C/C++ variable. For example, in the following code there are six variable declaration entries - two each for a and d, and one each for b and c: ``` extern int a; int a;