From 22a0596fca27d5f6678569094c190a9132b9bc8e Mon Sep 17 00:00:00 2001 From: Andrey Shishpanov Date: Wed, 22 Jul 2015 00:22:25 +0300 Subject: [PATCH] fixing trouble with casting from float reference to int, issue #1068 --- expr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/expr.cpp b/expr.cpp index 8c795e3b..697cdf3e 100644 --- a/expr.cpp +++ b/expr.cpp @@ -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; }