home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.bug
- Path: sparky!uunet!cis.ohio-state.edu!forseti.css.gov!tanida
- From: tanida@forseti.css.gov (Tom Tanida)
- Subject: Suggestion for a Warning for g++
- Message-ID: <9207272132.AA13851@forseti.css.gov>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Mon, 27 Jul 1992 21:32:10 GMT
- Approved: bug-gcc@prep.ai.mit.edu
- Lines: 32
-
- I'm using g++ 2.2.2, and am compiling the following:
-
- class A {
- public:
- virtual void f() const;
- };
-
- class B: public A {
- public:
- virtual void f();
- };
-
- main()
- {
- }
-
- This compiles cleanly, with no warnings (even with the switches
- -Wall and -Woverloaded-virtual). Under Borland C++ 3.1 I get:
-
- Warning: B::f() hides virtual function A::f()
-
- This warning is a reasonable one. I got the idea to try this
- from the "Effective C++" book by Scott Meyers (Addison-Wesley); it's
- Tip #48 or so- there's a reference to the ARM as to why this
- warning might be a good one to have.
-
- -Tom
- tanida@esosun.css.gov
-
- P.S. You've probably already heard this complaint, but I just thought I'd
- send it just in case. :-)
-
-