File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
cpp/autosar/src/rules/M5-0-2 Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,10 @@ import semmle.code.cpp.commons.Assertions
2020
2121class InsufficientlyParenthesizedExpr extends Expr {
2222 InsufficientlyParenthesizedExpr ( ) {
23- // Exclude assertions because if the child is the expression being asserted it
24- // is not necessary to add parenthesis.
25- not any ( Assertion a ) .getAsserted ( ) = this and
23+ // Exclude expressions affected by macros, including assertions, because
24+ // it is unclear that the expression must be parenthesized since it seems
25+ // to be the top-level expression instead of an operand of a binary or ternary operation.
26+ not this .isAffectedByMacro ( ) and
2627 (
2728 exists ( BinaryOperation root , BinaryOperation child | child = this |
2829 root .getAnOperand ( ) = child and
You can’t perform that action at this time.
0 commit comments