This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12341] New: Request for additional warning for variable shadowing
- From: "bero at arklinux dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Sep 2003 15:28:35 -0000
- Subject: [Bug c++/12341] New: Request for additional warning for variable shadowing
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12341
Summary: Request for additional warning for variable shadowing
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bero at arklinux dot org
CC: gcc-bugs at gcc dot gnu dot org
class A {
public:
A() { }
protected:
int aaa;
};
class B:public A {
public:
B():A() { }
protected:
int aaa;
};
compiles without a warning, and is a potential source of hard to trace problems
(while it can, of course, be used intentionally).
It may be useful to give a warning akin to the one given in the case of
void blah(int a)
{
int a;
}