File tree 1 file changed +4
-16
lines changed
cpp/autosar/src/rules/A0-1-3
1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -41,15 +41,6 @@ predicate overloadedFunctionIsCalled(Function unusedFunction) {
41
41
)
42
42
}
43
43
44
- /** Checks if a Function is part of an unevaluated context. */
45
- predicate partOfUnevalutedContexts ( Function unusedFunction ) {
46
- exists ( Expr e , FunctionCall f | ( ( e instanceof TypeidOperator or
47
- e instanceof SizeofOperator or
48
- e instanceof NoExceptExpr ) and
49
- e .getAChild * ( ) = f and f .getTarget ( ) = unusedFunction
50
- )
51
- )
52
- }
53
44
54
45
/** Checks if a Function's address was taken. */
55
46
predicate addressBeenTaken ( Function unusedFunction )
@@ -121,13 +112,10 @@ where
121
112
// - It's part of an overloaded set and any one of the overloaded instance
122
113
// is called.
123
114
// - It's an operand of an expression in an unevaluated context.
124
- (
125
- not unusedLocalFunction .isDeleted ( ) and
126
- not unusedLocalFunction .getAnAttribute ( ) .getName ( ) = "maybe_unused" and
127
- not overloadedFunctionIsCalled ( unusedLocalFunction ) and
128
- not addressBeenTaken ( unusedLocalFunction ) and
129
- not partOfUnevalutedContexts ( unusedLocalFunction )
130
- )
115
+ not unusedLocalFunction .isDeleted ( ) and
116
+ not unusedLocalFunction .getAnAttribute ( ) .getName ( ) = "maybe_unused" and
117
+ not overloadedFunctionIsCalled ( unusedLocalFunction ) and
118
+ not addressBeenTaken ( unusedLocalFunction )
131
119
and
132
120
// Get a printable name
133
121
(
You can’t perform that action at this time.
0 commit comments