diff --git a/cmd/genbindings/emitcabi.go b/cmd/genbindings/emitcabi.go index 3b78ebf2..2bd7f1cf 100644 --- a/cmd/genbindings/emitcabi.go +++ b/cmd/genbindings/emitcabi.go @@ -233,6 +233,8 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) { afterCall = "\t// Copy-construct value returned type into heap-allocated copy\n" afterCall += "\treturn static_cast
(new " + m.ReturnType.ParameterType + "(ret));\n" + } else if m.ReturnType.Const { + shouldReturn += "(" + emitReturnTypeCabi(m.ReturnType) + ") " } preamble, forwarding := emitParametersCABI2CppForwarding(m.Parameters)