-
Notifications
You must be signed in to change notification settings - Fork 786
Closed
Description
Input C/C++ Header
class X {
public:
X();
}Bindgen Invocation
$ bindgen input.h -- -target wasm32-wasi -xc++ -fvisibility=default
Actual Results
extern "C" {
#[link_name = "\u{1}_ZN1XC1Ev"]
pub fn X_X(this: *mut X);
}Expected Results
extern "C" {
#[link_name = "\u{1}_ZN1XC1Ev"]
pub fn X_X(this: *mut X) -> *mut X;
}I went to try and fix this myself, and found this code, so there seems to be some larger bug:
rust-bindgen/src/ir/function.rs
Lines 499 to 506 in a467d3e
| let ret = if is_constructor && ctx.is_target_wasm32() { | |
| // Constructors in Clang wasm32 target return a pointer to the object | |
| // being constructed. | |
| let void = Item::builtin_type(TypeKind::Void, false, ctx); | |
| Item::builtin_type(TypeKind::Pointer(void), false, ctx) | |
| } else { | |
| Item::from_ty_or_ref(ty_ret_type, cursor, None, ctx) | |
| }; |
Metadata
Metadata
Assignees
Labels
No labels