Objects of the same name in base and derived class not getting flagged as an error

Posted by John Smith on Stack Overflow See other posts from Stack Overflow or by John Smith
Published on 2010-05-05T00:54:26Z Indexed on 2010/05/05 0:58 UTC
Read the original article Hit count: 213

Filed under:
|
class Base
{
public:
 type1 m_Pants;
};

class Derived : Base
{
public:
 type2 m_Pants
};

This essentially didn't get flagged as an error, but was creating all kinds of clobbering and issues throughout a project.

Does anyone know of a technicality that wouldn't flag this?

© Stack Overflow or respective owner

Related posts about inheritance

Related posts about c++