Is there any rule which makes clang tidy to warn about useless reinterpret_cast where static_cast can be used ? E.g.
void f(void* p)
{
int* x = reinterpret_cast<int*>(p);
// static_cast is enough here
}
Is there any rule which makes clang tidy to warn about useless reinterpret_cast where static_cast can be used ? E.g.
void f(void* p)
{
int* x = reinterpret_cast<int*>(p);
// static_cast is enough here
}
There is no such check in clang-tidy.
If you need this check, you'll have to write it yourself. There is a similar one that can be used as a starting point - google-readability-casting checks for C-style casts and can automatically fix them in cases static_cast is sufficient.