http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14710

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-14 
10:52:18 UTC ---
I can see some value in the base class case too, but whether it's useless
depends on context, here the exact same casts are not redundant because they
select between two overloads:

struct A { int a; };
struct B : A { int b; };
void func(A *);
void func(B *);

int main()
{
    B b;

    func((A*)&b);
    func(static_cast<A*>(&b));
}


Should it apply in templates? When casting to reference types as well as
pointers? That might give a warning for std::forward and similar cases, which
are entirely correct.

Reply via email to