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