diff --git a/cpp/ql/src/semmle/code/cpp/Initializer.qll b/cpp/ql/src/semmle/code/cpp/Initializer.qll index 26c65049942..d407ba4ddee 100644 --- a/cpp/ql/src/semmle/code/cpp/Initializer.qll +++ b/cpp/ql/src/semmle/code/cpp/Initializer.qll @@ -1,7 +1,19 @@ import semmle.code.cpp.controlflow.ControlFlowGraph /** - * A C/C++ declaration initializer. + * A C/C++ declaration initializer. For example the initializers `1`, `2` and + * `3` in the following code: + * ``` + * int myVariable = 1; + * + * enum myEnum { + * MYENUMCONST = 2 + * }; + * + * void myFunction(int param = 3) { + * ... + * } + * ``` */ class Initializer extends ControlFlowNode, @initialiser { override Location getLocation() { initialisers(underlyingElement(this),_,_,result) } diff --git a/cpp/ql/src/semmle/code/cpp/Parameter.qll b/cpp/ql/src/semmle/code/cpp/Parameter.qll index 751a06c7fc6..01fda320d35 100644 --- a/cpp/ql/src/semmle/code/cpp/Parameter.qll +++ b/cpp/ql/src/semmle/code/cpp/Parameter.qll @@ -3,7 +3,18 @@ import semmle.code.cpp.Declaration private import semmle.code.cpp.internal.ResolveClass /** - * A C/C++ function parameter or catch block parameter. + * A C/C++ function parameter or catch block parameter. For example the + * function parameter `p` and the catch block parameter `e` in the following + * code: + * ``` + * void myFunction(int p) { + * try { + * ... + * } catch (const std::exception &e) { + * ... + * } + * } + * ``` * * For catch block parameters, there is a one-to-one correspondence between * the `Parameter` and its `ParameterDeclarationEntry`.