Open Quuxplusone opened 8 years ago
Bugzilla Link | PR26296 |
Status | NEW |
Importance | P enhancement |
Reported by | Jon Roelofs (jroelofs@jroelofs.com) |
Reported on | 2016-01-25 14:27:26 -0800 |
Last modified on | 2016-02-03 14:07:15 -0800 |
Version | unspecified |
Hardware | PC All |
CC | aaron@aaronballman.com, alexfh@google.com, djasper@google.com, jroelofs@jroelofs.com, klimek@google.com, legalize@xmission.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I don't think we need another cast-related check, since we have several of those. For example, there's google-readability-casting, which already provides fixes in some cases. Feel free to add support for generating chains of named casts for more complex cases. Maybe we should even join all c-style-cast-related checks to one check with a number of options.
In the example provided, the cast to void * is redundant, whether done by C-
style cast or static_cast<>.
Every pointer type is implicitly convertible to pointer to void.
The converse is not true.
See section 4.10 Pointer converions [conv.ptr] in the C++ standard.
> In the example provided, the cast to void * is redundant, whether done by C-
style cast or static_cast<>.
Oops, right... got it backwards.