Source:
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); } if (positiveType.isSameType(negativeType)) return positiveType; return null; }

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; }