Extra Clang Tools 5 documentation

clang-tidy - misc-redundant-expression

«  misc-non-copyable-objects   ::   Contents   ::   misc-sizeof-container  »

misc-redundant-expression

Detect redundant expressions which are typically errors due to copy-paste.

Depending on the operator expressions may be

Example:

((x+1) | (x+1))             // (x+1) is redundant
(p->x == p->x)              // always true
(p->x < p->x)               // always false
(speed - speed + 1 == 12)   // speed - speed is always zero

«  misc-non-copyable-objects   ::   Contents   ::   misc-sizeof-container  »