-
Notifications
You must be signed in to change notification settings - Fork 150
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
shared_ptr<const int>
leads to C++ code that doesn't compile
#799
Comments
Bleah, not having any luck running that workaround through autocxx either. The typedef gets resolved which strips the |
It feels to me as though the solution here is to fix dtolnay/cxx#850, and probably the way to fix that is unfortunately to make a whole new equivalent to The codebase I'm working with does not tend to use Here's a proposed phasing for how this could be tackled.
|
I think the same thing applies to other smart pointer types, like I agree that making another set of smart pointer types seems like the way to solve it. Or maybe |
Documenting my workaround for anybody who sees this before it's fixed: I hid the |
This makes function_properties_ref_t not const, in order to work around cxx - I'm assuming google/autocxx#799 / dtolnay/cxx#850
This makes function_properties_ref_t not const, in order to work around cxx - I'm assuming google/autocxx#799 / dtolnay/cxx#850
Expected Behavior
Emit bindings that work. dtolnay/cxx#1006 says that inserting a typedef results in
cxx::bridge
handling it already. dtolnay/cxx#850 talks about making it easier.dtolnay/cxx#537 and dtolnay/cxx#885 have some discussions around making this type more useful, but that seems like a secondary problem.
Actual Behavior
C++ code with
shared_ptr<const int>
produces generated C++ that doesn't compile because it tries usingshared_ptr<int>
. It looks like bindgen is stripping out the necessary information before autocxx has a chance to do anything about it :(.Steps to Reproduce the Problem
#800 has a test case with
int
.Opaque C++ types might need to be handled differently. My code actually uses
absl::Span
, which might have other issues that require a hand-written intermediate typedef regardless.Specifications
The text was updated successfully, but these errors were encountered: