浏览代码

[cpp] Better logic for working out type of set expression

hughsando 8 年之前
父节点
当前提交
98c960998c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/generators/gencpp.ml

+ 1 - 1
src/generators/gencpp.ml

@@ -2895,7 +2895,7 @@ let retype_expression ctx request_type function_args function_type expression_tr
             | OpDiv -> TCppScalar("Float")
             | OpBoolAnd | OpBoolOr -> TCppScalar("bool")
             | OpAnd | OpOr | OpXor | OpShl | OpShr | OpUShr -> TCppScalar("int")
-            | OpAssign -> cpp_type_of left.etype
+            | OpAssign -> (retype TCppUnchanged left).cpptype
             | _ -> TCppUnchanged
             in
             let e1 = retype binOpType left in