🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #293

Suggestion for a Warning for g++

#293
From: Tom Tanida
Date: Mon, 27 Jul 1992 21:32
31 lines
1118 bytes
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. :-)
Technical Details
Message-ID: <9207272132.AA13851@forseti.css.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!forseti.css.gov!tanida

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!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