diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/StatementHasNoEffectChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/StatementHasNoEffectChecker.java index 14d4d61a078..e961646a02e 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/StatementHasNoEffectChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/StatementHasNoEffectChecker.java @@ -63,7 +63,8 @@ public class StatementHasNoEffectChecker extends AbstractIndexAstChecker { /** * We consider has not effect binary statements without assignment and - * unary statement which is not dec and inc + * unary statement which is not dec and inc. If operator is overloaded + * we not going to bother. * * @param e * @return @@ -74,6 +75,8 @@ public class StatementHasNoEffectChecker extends AbstractIndexAstChecker { if (binExpr.getOperator() == IASTBinaryExpression.op_assign) return false; if (binExpr instanceof CPPASTBinaryExpression) { + // unfortunately ICPPASTBinaryExpression does not have + // getOverload public method CPPASTBinaryExpression cppBin = (CPPASTBinaryExpression) binExpr; ICPPFunction overload = cppBin.getOverload(); if (overload != null)