You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code snippet will trigger readability-redundant-casting and suggests removing the static_cast. Doing so would lead to a compilation failure.
class A
{
int a;
};
class B : public A
{
};
int main()
{
A a;
B b = static_cast<B>(a); // [warning: redundant explicit casting to the same type 'B' as the sub-expression, remove this casting [readability-redundant-casting]]
}