I don't think such a warning exists. I remember posting something to this list (maybe 2 years ago? buried in a somewhat unrelated thready I think) about this. Apparently this is explicitly allowed by the standard.

On Fri, Dec 21, 2012 at 11:16 AM, John Peterson <jwpeterson@gmail.com> wrote:
Some quick googling didn't lead to anything helpful, so I thought I'd
ask here.  Does anyone know of a compiler flag that will emit a
warning about the following code?  -Wshadow doesn't say anything about

struct A
  int x;

struct B : A
  // redeclare a variable that exists in A
  int x;

int main()
  B b;
  return 0;


LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
Libmesh-devel mailing list