Selaa lähdekoodia

[cpp] Do not StaticCast references or pointers

hughsando 9 vuotta sitten
vanhempi
commit
eac745857d
1 muutettua tiedostoa jossa 10 lisäystä ja 6 poistoa
  1. 10 6
      src/generators/gencpp.ml

+ 10 - 6
src/generators/gencpp.ml

@@ -2076,12 +2076,16 @@ let is_array_splice_call obj member =
 ;;
 
 let cpp_can_static_cast funcType inferredType =
-   match inferredType with
-   | TCppInst _
-   | TCppClass
-   | TCppEnum _
-      -> (tcpp_to_string funcType) <> (tcpp_to_string inferredType)
-   | _ -> false
+   match funcType with
+   | TCppReference(_) | TCppStar(_) -> false
+   | _ ->
+      (match inferredType with
+      | TCppInst _
+      | TCppClass
+      | TCppEnum _
+         -> (tcpp_to_string funcType) <> (tcpp_to_string inferredType)
+      | _ -> false
+   )
 ;;
 
 let cpp_member_name_of member =