Skip to content

Commit 1212108

Browse files
committed
Remove assignment to std::ignore
It was already being handled by the above `fc.getParent() instanceof ExprStmt` and `not f instanceof Operator`.
1 parent b89c564 commit 1212108

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

cpp/autosar/src/rules/A0-1-2/UnusedReturnValue.ql

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ import codingstandards.cpp.autosar
1919
import codingstandards.cpp.Operator
2020
import cpp
2121

22-
class StdIgnoreVariable extends NamespaceVariable {
23-
StdIgnoreVariable() {
24-
this.hasName("ignore") and
25-
this.getNamespace() instanceof StdNamespace
26-
}
27-
}
28-
2922
/*
3023
* This query performs a simple syntactic check to ensure that the return value of the function is
3124
* not completely ignored. This matches the examples given in the rule, although the text itself is
@@ -58,10 +51,5 @@ where
5851
cast.getExpr() = fc and
5952
cast.getActualType() instanceof VoidType
6053
)
61-
) and
62-
// Exclude assignments to std::ignore.
63-
not (
64-
fc.getTarget() instanceof AssignmentOperator and
65-
fc.getAChild().(VariableAccess).getTarget() instanceof StdIgnoreVariable
6654
)
6755
select fc, "Return value from call to $@ is unused.", f, f.getName()

0 commit comments

Comments
 (0)