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 <jwpeter...@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
> it...
>
>
> struct A
> {
> int x;
> };
>
>
> struct B : A
> {
> // redeclare a variable that exists in A
> int x;
> };
>
>
> int main()
> {
> B b;
> return 0;
> }
>
>
> --
> John
>
>
> ------------------------------------------------------------------------------
> 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
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Libmesh-devel mailing list
> Libmesh-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libmesh-devel
>
------------------------------------------------------------------------------
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
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel