1. Compiler warnings may give important information, such as:
class b{public: virtualvoidconst; ...}; class D: public b{public: virtualvoid f (); ...};
Since F in B is a const member function, and F in D is non-const, D::F is an override of B::f instead of a re-declaration, and the compiler usually gives a warning "warning:d:f () hides virtual b::f ()". This warning actually contains two meanings:
1). D did not re-declare virtual void F () const, so it inherits the virtual void F () const implementation of B.
2). Because d declares virtual void F (), it is a rewrite of the virtual void F () const, and because of the name masking, virtual void f () const cannot be invoked through the D type object.
Therefore, the following conditions occur (see note):
B b;d D; B* pb=&B;PB->f (); // The call is B::f ()pb=&d;pb->f (); // The call is still B::f ()!
2. Different compilers have different warning standards, so you cannot rely on the compiler to indicate errors.
Effective C + + clause 53 don't overlook compiler warnings