You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
include_cpp!{
#include "main.h"
safety!(unsafe_ffi)// This won't help, autocxx will still attempt to generate against the real MyUnsupportedType
extern_cpp_opaque_type!("MyUnsupportedType", ffi2::MyUnsupportedType)
subclass!("MySuperType", MyDerivedType)}#[cxx::bridge]mod ffi2 {unsafeextern"C++"{typeMyUnsupportedType;}}#[subclass]#[derive(Default)]pubstructMyDerivedType{}impl ffi::MySuperType_methodsforMyDerivedType{unsafefnDoSomething(&self,foo:*mut ffi::MyUnsupportedType,bar:*mutffi:MySupportedType){unimplemented!("no lol")}}
Error: × cxx couldn't handle our generated bindings - could be a bug in autocxx:
│ unsupported type: MyUnsupportedType
Expected Behavior
It could be nice to allow the above (or similar) to work, i.e. if cxx can't handle a type then allow it to be used in an opaque manner.
I see. Would you be kind enough to make a pull request which has a reproducible test case? (Ideally as a new integration test but failing that, changes to one of the existing demos/examples).
I spent a while trying to reproduce this but couldn't. I landed a test case in #1330. Please raise a new bug with a test case if you're still having trouble.
When attempting to subclass a type that refers to types that can't be automatically converted by autocxx, compile will fail:
main.h
main.rs
Expected Behavior
It could be nice to allow the above (or similar) to work, i.e. if cxx can't handle a type then allow it to be used in an opaque manner.
Actual Behavior
Compile fails as above.
(Could this be related to #1278?)
Steps to Reproduce the Problem
See code above.
The text was updated successfully, but these errors were encountered: