-
Notifications
You must be signed in to change notification settings - Fork 151
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
autocxx does not recognize concrete subclasses of abstract base classes #774
Comments
Thanks. Yep, a pull request with a test case would be greatly appreciated and will likely yield a quicker fix. Nevertheless thanks for the minimal test case. |
I've added an integration test; see pull request #775 . |
Thanks for the test! OK, an initial diagnosis by running your test and looking at the diagnostics. I'd argue that we have three separate bugs here.
I plan to confirm my understanding regarding Bug 2, and if so, remove this code that relates to allowlisting base classes. Obviously if all's well, that renders the documentation change ("bug 1") unnecessary. If all's well there, I'll go ahead and tackle Bug 3 which shouldn't be drastically hard. It would be great if you can accept the CLA so I can land your test. Thanks again for the report! |
Previously we required base classes to be on the allowlist, on the assumption that we were otherwise unable to see functions belonging to base classes and thus determine whether they were abstract. This was possibly a wrong assumption - it looks like bindgen fully generates base classes for anything on the allowlist. Let's test that. Relates to #774.
I had to create a new pull request in order to accept the CLA. Sorry for the inconvenience, but the new one allowed me to accept the CLA and is otherwise identical. |
No problem at all, sorry for the inconvenience of the CLA. I have fixed "Bug 2" (which renders "Bug 1" irrelevant). This is already a usability improvement for autocxx users, so thanks for that. Bug 3 will be a little more involved as we'll have to track which pure virtual functions have been overridden and therefore the net 'abstract'ness of each type. If anyone reading this wants to have a go at it, the code is in |
Minimal Working Example
(I think it's minimal. I'll try to add a pull request with a new test in due course.)
Test.h
build.rs
main.rs
Expected Behavior
The generated
struct B
has amake_unique
implementation.Actual Behavior
The generated
struct B
has aDrop
implementation but nomake_unique
. It is not clear how I could instantiate a variable of typeB
.Steps to Reproduce the Problem
See above
Specifications
The text was updated successfully, but these errors were encountered: