-
Notifications
You must be signed in to change notification settings - Fork 745
clang::Cursor::num_template_args should return Option<u32> #121
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
Comments
Please make a comment here if you intend to work on this issue. Thank you! |
Should it return Option instead of Option (as c_int == i32, this is the closest unsigned type) ? |
Yeah, both |
Ok, I will take care of this issue then. |
Great, thanks! |
Fix #121: Cursor::num_template_args(...) returns Option<u32> instead of c_int Now, functions calling Cursor::num_template_args() call expect() on the return value to make sure it is a valid value
Right now it returns a
c_int
, but the documentation forclang_Cursor_getNumTemplateArgs
says it returns-1
if the cursor's referent is not a template declaration or specialization. We should translate negative values intoNone
and positive values intoSome
. This will also require fixing up callers.I can mentor someone who wants to pick up this bug.
The text was updated successfully, but these errors were encountered: