当派生类成员变量名称影响其父类之一时,是否有一种生成警告的方法,例如
class Mother { public: Mother() : i(0) {} virtual ~Mother() {} protected: int i; }; class Child : public Mother { public: Child() : Mother(),i(0) {} virtual ~Child() {} protected: int i; /* NOK Expecting warning : declaration of 'int Child::i' shadows 'int Mother::i' */ };