Skip to content

Commit 73c075d

Browse files
committed
Fix #796
1 parent 85036d5 commit 73c075d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

change_notes/2024-11-13-fix-fp-796.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `A13-3-1` - `FunctionThatContainsForwardingReferenceAsItsArgumentOverloaded.ql`:
2+
- Reduce false positives by explicitly checking that the locations of overloaded functions are different.

cpp/autosar/src/rules/A13-3-1/FunctionThatContainsForwardingReferenceAsItsArgumentOverloaded.ql

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ where
2929
OperatorsPackage::functionThatContainsForwardingReferenceAsItsArgumentOverloadedQuery()) and
3030
not f.isDeleted() and
3131
f = c.getAnOverload() and
32+
// CodeQL sometimes fetches an overloaded function at the same location.
33+
// Thus, a check is added explicitly (refer #796).
34+
f.getLocation() != c.getLocation() and
3235
// allow for overloading with different number of parameters, because there is no
3336
// confusion on what function will be called.
3437
f.getNumberOfParameters() = c.getNumberOfParameters() and

0 commit comments

Comments
 (0)