balazske wrote: > Operands of `&&` and `||` are checked. It would be nice to check operand of > `!` as well.
The check was designed to confirm to the CERT rule where `!` is not mentioned. Still it looks better to check it too because it expects a logical type of value. From other point of view, most often `a != b` is more likely to be used for a comparison and use of `!(a = b)` may indicate intentional assignment. The check could be extended to check cases like `bool x = a = b` but only if variable has `bool` (C++) type (assignment expression in assignment to boolean values or passed parameters, assignments in return of `bool` type) (probably exclude cases where all participating values are `bool`). The `bool` values may be used in conditions where the assignment would be detected. https://github.com/llvm/llvm-project/pull/180219 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
