home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.g++.bug
- Path: sparky!uunet!cis.ohio-state.edu!cs.joensuu.fi!hvaisane
- From: hvaisane@cs.joensuu.fi (H. Vaisanen)
- Subject: Bug or feature: shadowing a member of this
- Message-ID: <9211200925.AA23043@cs.joensuu.fi>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Fri, 20 Nov 1992 13:25:18 GMT
- Approved: bug-g++@prep.ai.mit.edu
- Lines: 21
-
- Should the compiler give this warning?
-
- class Foo {
- int bar;
- public:
- int Bar() const {return bar;};
- };
-
- main()
- {
- int Bar; // `Bar' shadows a member of `this' ??
- }
- ---
-
- % g++ -Wshadow -c a.C
- a.C: In function `int main ()':
- a.C:9: warning: declaration of `Bar' shadows a member of `this'
- % g++ -v
- Reading specs from /usr/local/Gnu/lib/gcc-lib/decstation-3100/2.3.1/specs
- gcc version 2.3.1
-
-