Skip to content

Commit 156a174

Browse files
committed
C++: Add explanation.
1 parent 96098c5 commit 156a174

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ Function getConstructedFrom(Function f) {
2929
* This should not happen in a single application but since we
3030
* have a system wide view it is likely to happen for instance for
3131
* the main function.
32+
*
33+
* Note: we use `getConstructedFrom` to ensure that we look at template
34+
* functions rather than their instantiations. We get better results this way
35+
* as the instantiation is artificial and may have inherited parameter names
36+
* from the declaration rather than the definition.
3237
*/
3338
ParameterDeclarationEntry functionParameterNames(Function f, string name) {
3439
exists(FunctionDeclarationEntry fe |

0 commit comments

Comments
 (0)