This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12341] New: Request for additional warning for variable shadowing


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; 
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]