File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed
cpp/autosar/src/rules/A0-1-3 Expand file tree Collapse file tree 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) {
4141 )
4242}
4343
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- }
5344
5445/** Checks if a Function's address was taken. */
5546predicate addressBeenTaken ( Function unusedFunction )
@@ -121,13 +112,10 @@ where
121112 // - It's part of an overloaded set and any one of the overloaded instance
122113 // is called.
123114 // - 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 )
131119 and
132120 // Get a printable name
133121 (
You can’t perform that action at this time.
0 commit comments