-
Notifications
You must be signed in to change notification settings - Fork 746
feature request: add option to map nonull to ptr::NonNull #1791
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
We have other code for reading attributes see I don't expect this to be that much harder. |
I've looked at this a bit, and would like to try implementing it, but I think I'm gonna need some help with it: From what I can tell we need to use All of these things require Next, I was considering parsing that into a new Lastly, I'm having problems with getting the "inner" type, neither Thanks in advance! Related: #1876 (the |
Sorry for the lag replying here.
In terms of the version checks, yeah, you can do something like:
Regarding the inner type, it seems the right function to use is clang_Type_getModifiedType. |
There is supported by clang extension to mark pointers as nonnull
Input C/C++ Header
It would be nice to have option to automatically convert types with such attribute to
std::ptr::NonNull
,this
repr(transparent)
type so this would be valid transformation.I deal with big enough C API where a lot of argument types have such attribute,
and this automatic conversation will help.
The text was updated successfully, but these errors were encountered: