-
Notifications
You must be signed in to change notification settings - Fork 521
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
Crash on spaceship operator #1891
Comments
You could try compiling from source and adding spaceship operator starting here: https://github.com/mono/CppSharp/blob/main/src/Parser/ASTConverter.cs#L1367 Otherwise probably easier to just rewrite the input C++ code, as annoying as it is. |
Sure, I'll give it a go. Thanks for the quick reply :) |
So I managed to get it to build in c++20 debug mode (with some edits that I'll make a PR for soon) so I can see if my changes actually work, but I'm running into the following error: 10>------ Rebuild All started: Project: Encodings.Gen, Configuration: Debug x64 ------ I'll continue investigating tomorrow, but if you have any idea what might cause this missing record or if you see something I did incorrectly let me know |
That seems to be some new kind of C++ type we cannot handle yet: CppSharp/src/CppParser/Parser.cpp Line 963 in 56f1b7c
Can you share the lines around You can also try calling |
Some kind of templated type, can you dump the type? Think that should tell us what we need to know. |
The dump output is:
|
What's the call stack when the assert hits? |
And you can try something like: else if (auto TPT = Ty->getAs<clang::TemplateTypeParmType>())
return nullptr; |
Not sure how to debug the c++ bit atm. It came up as a part of building another project:
Edit: |
Ah, now a new error appeared.
Which is around this source: Anyway, thanks for the help so far. I'm gonna take the rest of the night off though, I'll be back tomorrow to continue trying to get this working :p |
Okay, made a PR for those compiler error fixes #1892 |
@tritao Got a quick question for you though. Does the shipped version of llvm already support c++20 ? (Though I think I might know already. I guess I need to change the C# hardcoded config in the test projects somewhere) |
Nice. It should support C++20, you probably need to enable it in the parser options around here: |
I just installed this nuget package so I'm not very familiar with this tool yet. It seems the converter for the spaceship operator is not implemented. I get the following debug crash if I try to parse a file that has the spaceship operator.
If I was more familiar I'd try to fix it myself, but I don't feel comfortable enough to do so yet. In the meantime, is there a way to pre-process this file to convert this operator implementation into the equivalent <, <=, ==, >=, > operator pairs?
The text was updated successfully, but these errors were encountered: