Source:
<code>private IType computeResultType(IASTExpression positiveExpression, IASTExpression negativeExpression, IType positiveType, IType negativeType) { if (positiveType instanceof IBasicType && negativeType instanceof IBasicType) { if (((IBasicType) positiveType).getKind() == IBasicType.Kind.eVoid && ((IBasicType) negativeType).getKind() == IBasicType.Kind.eVoid) { return CBasicType.VOID; } return CArithmeticConversion.convertCOperandTypes(IASTBinaryExpression.op_plus, positiveType, negativeType); } if (positiveType instanceof ICompositeType && negativeType instanceof ICompositeType) { if (positiveType.isSameType(negativeType)) { return positiveType; } } if (CVisitor.isNullPointerConstant(positiveExpression) && negativeType instanceof IPointerType) { return negativeType; } else if (CVisitor.isNullPointerConstant(negativeExpression) && positiveType instanceof IPointerType) { return positiveType; } else if (positiveType instanceof IPointerType && negativeType instanceof IPointerType) { IType positivePointeeCV = ((IPointerType) positiveType).getType(); IType negativePointeeCV = ((IPointerType) negativeType).getType(); IType positivePointee = CVisitor.unwrapCV(positivePointeeCV); IType negativePointee = CVisitor.unwrapCV(negativePointeeCV); IType resultPointee; if (positivePointee.isSameType(CBasicType.VOID) || negativePointee.isSameType(CBasicType.VOID)) { resultPointee = CBasicType.VOID; } else { resultPointee = negativePointee; } return new CPointerType( ExpressionTypes.restoreCV(resultPointee, positivePointeeCV, negativePointeeCV), 0); } <START> if (positiveType.isSameType(negativeType)) <END> return positiveType; return null; }</code><technical_language>This is miss case where, say, operand type |struct MyStruct|, other, |const struct MyStruct|. I suggest handling this unwrapping top-level IQualifierType beginning of function, so: if (positiveType instanceof IQualifierType) { positiveType = ((IQualifierType) positiveType).getType(); } similarly for negativeType</technical_language>

Target:
private IType computeResultType(IASTExpression positiveExpression, IASTExpression negativeExpression, IType positiveType, IType negativeType) { positiveType = CVisitor.unwrapCV(positiveType); negativeType = CVisitor.unwrapCV(negativeType); if (positiveType instanceof IBasicType && negativeType instanceof IBasicType) { if (((IBasicType) positiveType).getKind() == IBasicType.Kind.eVoid && ((IBasicType) negativeType).getKind() == IBasicType.Kind.eVoid) { return CBasicType.VOID; } return CArithmeticConversion.convertCOperandTypes(IASTBinaryExpression.op_plus, positiveType, negativeType); } if (positiveType instanceof ICompositeType && negativeType instanceof ICompositeType) { if (positiveType.isSameType(negativeType)) { return positiveType; } } if (CVisitor.isNullPointerConstant(positiveExpression) && negativeType instanceof IPointerType) { return negativeType; } else if (CVisitor.isNullPointerConstant(negativeExpression) && positiveType instanceof IPointerType) { return positiveType; } else if (positiveType instanceof IPointerType && negativeType instanceof IPointerType) { IType positivePointeeCV = ((IPointerType) positiveType).getType(); IType negativePointeeCV = ((IPointerType) negativeType).getType(); IType positivePointee = CVisitor.unwrapCV(positivePointeeCV); IType negativePointee = CVisitor.unwrapCV(negativePointeeCV); IType resultPointee; if (positivePointee.isSameType(CBasicType.VOID) || negativePointee.isSameType(CBasicType.VOID)) { resultPointee = CBasicType.VOID; } else { resultPointee = negativePointee; } return new CPointerType( ExpressionTypes.restoreCV(resultPointee, positivePointeeCV, negativePointeeCV), 0); } return null; }