Fix wrapper for operator bool of TypeHandle

This commit is contained in:
rdb 2015-09-19 14:50:59 +02:00
parent 445c3461d6
commit 1d9aff0c48

View File

@ -146,20 +146,17 @@ call_function(ostream &out, int indent_level, bool convert_result,
} else if (_type == T_typecast_method) { } else if (_type == T_typecast_method) {
// A typecast method can be invoked implicitly. // A typecast method can be invoked implicitly.
string cast_expr = ostringstream cast_expr;
"(" + _return_type->get_orig_type()->get_local_name(&parser) + ")"; cast_expr << "("
<< _return_type->get_orig_type()->get_local_name(&parser) << ")";
if (TypeManager::is_handle(_cpptype)) { _parameters[0]._remap->pass_parameter(cast_expr, container);
cast_expr += "(" + container + ")";
} else {
cast_expr += "(*" + container + ")";
}
if (!convert_result) { if (!convert_result) {
return_expr = cast_expr; return_expr = cast_expr.str();
} else { } else {
string new_str = string new_str =
_return_type->prepare_return_expr(out, indent_level, cast_expr); _return_type->prepare_return_expr(out, indent_level, cast_expr.str());
return_expr = _return_type->get_return_expr(new_str); return_expr = _return_type->get_return_expr(new_str);
} }