Skip to content

Commit 56d886e

Browse files
committed
Fix as per review comments
1 parent 2623c22 commit 56d886e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import cpp
1616
import codingstandards.cpp.autosar
17+
import codingstandards.cpp.FunctionEquivalence
1718

1819
class Candidate extends TemplateFunction {
1920
Candidate() {
@@ -29,9 +30,8 @@ where
2930
OperatorsPackage::functionThatContainsForwardingReferenceAsItsArgumentOverloadedQuery()) and
3031
not f.isDeleted() and
3132
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
33+
// Ensure the functions are not equivalent to each other (refer #796).
34+
not f = getAnEquivalentFunction(c) and
3535
// allow for overloading with different number of parameters, because there is no
3636
// confusion on what function will be called.
3737
f.getNumberOfParameters() = c.getNumberOfParameters() and

0 commit comments

Comments
 (0)