-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested types don't work #115
Comments
I assume you closed this in favor of #124? I'm reopening to discuss issues specific to nested types and don't want to clog #124 with the details. Hope that's OK. I've started working on this, and I think what will be needed here is this:
What do you think? I've started having a look at how I would do the autocxx changes, and it seems a bit tricky to get the right information through to the C++ code generator. It looks like the change needs to happen in I assume I'll may have to build my own symbol table of sorts, maybe from the list of |
Update: I think we don't need to make any changes to cxx because it already has a |
Another update: Unfortunately, putting a qualified name like |
Update 3: I've taken another look at this and have realized that the unsafe impl cxx::ExternType for bindgen::root::A_B {
type Id = cxx::type_id!("A_B");
type Kind = cxx::kind::Opaque;
} When I saw this, I initially thought that maybe this is the only place that needs to be changed -- i.e. that the This interpretation seems to be supported by the docs for However, making this change to the code doesn't seem to make any difference to the type name that's used in the generated C++ code -- it's still I'm really just writing this down as "notes to myself" -- don't feel obliged to respond. |
Yeah... you're refreshing my memory of various problems here.
I think what we need to do is roughly what you propose:
|
Ha! That's crafty. I had seen that attribute but hadn't considered using it for this purpose. But it should work, as the syntax is exactly the same. Not doing nested types via
I'll give all of this a try and will let you know when I've got something that works. |
This is needed to allow autocxx to use the correct C++ name of the nested type in generated code. See google/autocxx#115 for details. I've updated some tests with the expected attributes. Hopefully, I've caught all tests that need updating; not all tests currently pass, and I didn't want to update the expected output for some of the tests that don't pass because I'm not sure if it's correct to do so.
Work in progress, not all tests pass yet. We use the `bindgen_original_type` attribute emitted by autocxx-bindgen to refer to the correct C++ type in generated C++ and Rust code. For details, see google#115
Work in progress, not all tests pass yet. We use the `bindgen_original_type` attribute emitted by autocxx-bindgen to refer to the correct C++ type in generated C++ and Rust code. For details, see google#115
We use the `bindgen_original_type` attribute emitted by autocxx-bindgen to refer to the correct C++ type in generated C++ and Rust code. For details, see google#115
We use the `bindgen_original_type` attribute emitted by autocxx-bindgen to refer to the correct C++ type in generated C++ and Rust code. For details, see google#115
is generated by
bindgen
asThis then gives errors when we refer to
A_B
in generated C++.The text was updated successfully, but these errors were encountered: