-
Notifications
You must be signed in to change notification settings - Fork 520
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
Fix incorrect tag generation for enum classes #1900
Conversation
Looks good, but its failing CI: https://github.com/mono/CppSharp/actions/runs/13123101712/job/36613458471?pr=1900#step:10:210 |
Hm, interesting.. I guess it's not enough to know if it's incomplete or not. Might look into it a bit tomorrow or just remove the early out for now |
@tritao I'm just running into an issue: Can you tell me why the |
I think it's because of this: https://github.com/mono/CppSharp/blob/main/src/CppParser/Parser.cpp#L1025 Basically it's almost rarely needed for binding purposes and makes a difference when it comes to performance. I am guessing it's causing issues in this new approach for this PR? |
Ah yeah, that makes total sense. |
@tritao So ran into a couple of issues again which I resolved today. I'll make more PR's for those in a bit. Last issue I'm dealing with now, is that if I enable parsing of the system headers, the generated
Any ideas? (I should also note that it now adds way more declarations then before) |
Kinda hard to say why, but if it's getting generated then presumably CppSharp think it's needed when it shouldn't, so maybe we should just ignore such It could be we're missing some check in those passes to skip system headers. |
Hm, yeah I noticed some other things as well, but I'll leave that discussion for later. Want to get this fixed first and maybe then ask some questions about how some things are designed currently cus I'm a little confused about translations units atm. |
00b8109
to
030e0cf
Compare
Currently invalid source is generated for scoped enums (
enum class
).This patch will resolve this issue by adding
class
when it is a scoped enum.I've also added an early out to skip printing the tag is the class isn't incomplete, since that shouldn't be necessary in those cases. (Though maybe we should add this as an option so you'd still be able to force print it. Eg. new method
PrintTagIfNeeded
?)