浏览代码

[cpp] Remove StaticCast of fixed override because it might be wrong

Hugh 9 年之前
父节点
当前提交
62f442f416
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/generators/gencpp.ml

+ 3 - 0
src/generators/gencpp.ml

@@ -2715,8 +2715,11 @@ let retype_expression ctx request_type function_args expression_tree forInjectio
 
          | _ -> cppExpr
       end else match cppExpr.cppexpr, cppExpr.cpptype, return_type with
+         (*  This detection of cpp_is_fixed_override and the real type is wrong then
+             the code explicitly casts the return value of a function
          | CppCall( FuncInstance(_,false,_), _ ), _,_ when cpp_is_fixed_override cppExpr.cpptype return_type
               -> mk_cppexpr (CppCastStatic(cppExpr,return_type)) return_type
+         *)
          | _, TCppObjC(k), TCppDynamic
               -> mk_cppexpr (CppCast(cppExpr,TCppDynamic)) return_type
          | _ -> cppExpr