Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Tom Tanida
Mon, 27 Jul 1992 21:32
Suggestion for a Warning for g++
Author: Tom Tanida
Date: Mon, 27 Jul 1992 21:32
Date: Mon, 27 Jul 1992 21:32
31 lines
1118 bytes
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. :-)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads