1 parent 7d609df commit b4ebcb4Copy full SHA for b4ebcb4
1 file changed
lib/checkother.cpp
@@ -3056,9 +3056,11 @@ void CheckOtherImpl::checkDuplicateExpression()
3056
}
3057
if (tok->str() != "=") {
3058
const Token* par = tok->astParent();
3059
- while (par && tok->str() == par->str() && precedes(par, tok)) { // chain of identical operators with parentheses
+ while (par && tok->str() == par->str() && precedes(par->astOperand1(), tok)) { // chain of identical operators with parentheses
3060
checkDuplicate(par->astOperand1(), tok->astOperand1(), par);
3061
checkDuplicate(par->astOperand1(), tok->astOperand2(), par);
3062
+ checkDuplicate(par->astOperand2(), tok->astOperand1(), par);
3063
+ checkDuplicate(par->astOperand2(), tok->astOperand2(), par);
3064
par = par->astParent();
3065
3066
0 commit comments