Skip to content

Commit b65e2f8

Browse files
committed
C++: Put QLDoc on two helper predicates
1 parent b38ca94 commit b65e2f8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
import cpp
1313

14-
// Names of parameters in the implementation of a function.
15-
// Notice that we need to exclude parameter names used in prototype
16-
// declarations and only include the ones from the actual definition.
17-
// We also exclude names from functions that have multiple definitions.
18-
// This should not happen in a single application but since we
19-
// have a system wide view it is likely to happen for instance for
20-
// the main function.
14+
/**
15+
* Gets the parameter of `f` with name `name`, which has to come from the
16+
* _definition_ of `f` and not a prototype declaration.
17+
* We also exclude names from functions that have multiple definitions.
18+
* This should not happen in a single application but since we
19+
* have a system wide view it is likely to happen for instance for
20+
* the main function.
21+
*/
2122
ParameterDeclarationEntry functionParameterNames(Function f, string name) {
2223
exists(FunctionDeclarationEntry fe |
2324
result.getFunctionDeclarationEntry() = fe and
@@ -29,6 +30,7 @@ ParameterDeclarationEntry functionParameterNames(Function f, string name) {
2930
)
3031
}
3132

33+
/** Gets a local variable in `f` with name `name`. */
3234
pragma[nomagic]
3335
LocalVariable localVariableNames(Function f, string name) {
3436
name = result.getName() and

0 commit comments

Comments
 (0)