The analyzer has detected that identical expressions surround a compound assignment operator. The operation may be incorrect and redundant, or it can be simplified.
The example:
x -= x - 5
In this case, the expression assigns the 5 value to the x variable. Most likely, the intended operation is to subtract 5 from the x variable.
The fixed code:
x = x - 5
Another option:
x -= 5
The diagnostic rule also applies to the following operators: +=, *=, /=, and %=.
You can look at examples of errors detected by the V8011 diagnostic. |
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders: