Source:
public boolean isNarrowingConversion(IASTNode point) { if (!fCouldNarrow) return false; if (!(target instanceof ICPPBasicType)) return false; ICPPBasicType basicTarget = (ICPPBasicType) target; CPPBasicType basicSource = null; if (source instanceof CPPBasicType) basicSource = (CPPBasicType) source; else if (source instanceof IEnumeration) { IEnumeration enumSource = (IEnumeration) source; if (enumSource instanceof ICPPEnumeration) { IType fixedType = ((ICPPEnumeration) enumSource).getFixedType(); if (fixedType instanceof CPPBasicType) { basicSource = (CPPBasicType) fixedType; } } if (basicSource == null) return !( ArithmeticConversion.fitsIntoType(basicTarget, enumSource.getMinValue()) && ArithmeticConversion.fitsIntoType(basicTarget, enumSource.getMaxValue())); } if (basicSource == null) return false; boolean constantExprExceptionApplies = false; if (BuiltinOperators.isFloatingPoint(basicSource) && BuiltinOperators.isIntegral(basicTarget)) return true; else if ( basicSource.getKind() == Kind.eDouble && ( basicTarget.getKind() == Kind.eFloat || (basicTarget.getKind() == Kind.eDouble && !basicTarget.isLong() && basicSource.isLong()))) constantExprExceptionApplies = true; else if (BuiltinOperators.isIntegral(basicSource) && BuiltinOperators.isFloatingPoint(basicTarget)) constantExprExceptionApplies = true; else if ( BuiltinOperators.isIntegral(basicSource) && BuiltinOperators.isIntegral(basicTarget) && !ArithmeticConversion.fitsIntoType(basicTarget, basicSource, point)) constantExprExceptionApplies = true; if (constantExprExceptionApplies) { Long val = basicSource.getAssociatedNumericalValue(); return val == null || !ArithmeticConversion.fitsIntoType(basicTarget, val.longValue()); } return false; }

Target:
public boolean isNarrowingConversion(IASTNode point) { if (!fCouldNarrow) return false; if (!(target instanceof ICPPBasicType)) return false; ICPPBasicType basicTarget = (ICPPBasicType) target; CPPBasicType basicSource = null; if (source instanceof CPPBasicType) { basicSource = (CPPBasicType) source; } else if (source instanceof IEnumeration) { IEnumeration enumSource = (IEnumeration) source; if (enumSource instanceof ICPPEnumeration) { IType fixedType = ((ICPPEnumeration) enumSource).getFixedType(); if (fixedType instanceof CPPBasicType) { basicSource = (CPPBasicType) fixedType; } } if (basicSource == null) { return !(ArithmeticConversion.fitsIntoType(basicTarget, enumSource.getMinValue()) && ArithmeticConversion.fitsIntoType(basicTarget, enumSource.getMaxValue())); } } if (basicSource == null) return false; boolean constantExprExceptionApplies = false; if (BuiltinOperators.isFloatingPoint(basicSource) && BuiltinOperators.isIntegral(basicTarget)) { return true; } else if (basicSource.getKind() == Kind.eDouble && (basicTarget.getKind() == Kind.eFloat || (basicTarget.getKind() == Kind.eDouble && !basicTarget.isLong() && basicSource.isLong()))) { constantExprExceptionApplies = true; } else if (BuiltinOperators.isIntegral(basicSource) && BuiltinOperators.isFloatingPoint(basicTarget)) { constantExprExceptionApplies = true; } else if ( BuiltinOperators.isIntegral(basicSource) && BuiltinOperators.isIntegral(basicTarget) && !ArithmeticConversion.fitsIntoType(basicTarget, basicSource, point)) { constantExprExceptionApplies = true; } if (constantExprExceptionApplies) { Long val = basicSource.getAssociatedNumericalValue(); return val == null || !ArithmeticConversion.fitsIntoType(basicTarget, val.longValue()); } return false; }