Do not suggest to take the address of a const pointer to get void*
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Sema/SemaFixItUtils.cpp | ||
---|---|---|
135–140 | Do we need to check the constness here? What other cases does it come up? Like maybe if it's volatile we'd want to do the same thing? |
clang/lib/Sema/SemaFixItUtils.cpp | ||
---|---|---|
135–140 | For volatile pointers the same bad suggestion appears. Maybe I should remove the isConstQualified check as IIRC all non-const non-volatile pointers can be implicitly converted to void* so the suggestion would not appear for them. Probably any suggestion to change T* to T** for casting to void* is unlikely to be correct. |
clang/lib/Sema/SemaFixItUtils.cpp | ||
---|---|---|
135–140 | yeah, that's what I was thinking - probably remove the const check and maybe add a test case showing the volatile case too |
clang/lib/Sema/SemaFixItUtils.cpp | ||
---|---|---|
136–137 | The rest of the function was made this way in commit 1e95bc0f4063e, so I thought this is the style for this part of the codebase |
Looks good, thanks!
Do you need me to commit this for you, or can you commit it yourself?
please make the title of the commit say what the commit is actually doing rather than only reference a bug number, the bug number should be in the description
Please commit it yourself as I don't have a commit access. This is my first patch here.
Should I change the title myself or you can change it during commit? If it's on me, how do I change it? git commit --amend; arc diff?
phabricator isn't very elegant, locally changing the commit message doesn't propagate to phabricator even with arc diff, you have to change it on phabricator, then to propagate it locally arc amend
That's OK, I'll just change it when I commit - I've got something lined up but didn't get it through yesterday.
Nit: we usually try to avoid repeating types.