diff options
author | Christoph Mallon <christoph.mallon@gmx.de> | 2018-07-20 14:53:39 +0200 |
---|---|---|
committer | Christoph Mallon <christoph.mallon@gmx.de> | 2018-07-20 14:53:39 +0200 |
commit | 397290495d9e56dd34b373d2f8a0549ac2034168 (patch) | |
tree | 0b9bfdbe1ab2ae60bf95d22d07e3dbffab84b9f5 | |
parent | 713474341f1ea00bc12570b48134bde0b0df5a96 (diff) |
Do not emit a warning for -Wnot-compound-assign when the operator is parenthesized.
This fixes C/nowarn/compoundassign.c.
-rw-r--r-- | src/parser/parser.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/parser/parser.c b/src/parser/parser.c index 26cbe83..c17a847 100644 --- a/src/parser/parser.c +++ b/src/parser/parser.c @@ -8646,6 +8646,7 @@ static void semantic_binexpr_assign(binary_expression_t *expression) /* If an equal sign is followed by an infix operator without spaces then it * was probably intended to be a compound assignment */ if (expression->base.kind == EXPR_BINARY_ASSIGN + && !expression->right->base.parenthesized && is_ambiguous_unary_expression_kind(expression->right->kind) && are_positions_contiguous(&expression->base.pos, &expression->right->base.pos)) |