Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #796 (A13-3-1) - Consider reporting overloaded functions that are at different locations. #797

Merged
merged 5 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions change_notes/2024-11-13-fix-fp-796.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `A13-3-1` - `FunctionThatContainsForwardingReferenceAsItsArgumentOverloaded.ql`:
- Reduce false positives by explicitly checking that the locations of overloaded functions are different.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ where
OperatorsPackage::functionThatContainsForwardingReferenceAsItsArgumentOverloadedQuery()) and
not f.isDeleted() and
f = c.getAnOverload() and
// CodeQL sometimes fetches an overloaded function at the same location.
// Thus, a check is added explicitly (refer #796).
f.getLocation() != c.getLocation() and
rak3-sh marked this conversation as resolved.
Show resolved Hide resolved
// allow for overloading with different number of parameters, because there is no
// confusion on what function will be called.
f.getNumberOfParameters() = c.getNumberOfParameters() and
Expand Down