fixing trouble with casting from float reference to int, issue #1068

This commit is contained in:
Andrey Shishpanov
2015-07-22 00:22:25 +03:00
parent dff48639e9
commit 22a0596fca

View File

@@ -7229,10 +7229,11 @@ TypeCastExpr::TypeCheck() {
// And otherwise see if it's one of the conversions allowed to happen
// implicitly.
if (CanConvertTypes(fromType, toType, "type cast expression", pos) == false)
Expr *e = TypeConvertExpr(expr, toType, "type cast expression");
if (e == NULL)
return NULL;
return this;
else
return e;
}