This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
-Wall addition to g++?
- To: egcs-bugs at cygnus dot com
- Subject: -Wall addition to g++?
- From: Stephen Hite <sch at leading dot net>
- Date: Tue, 9 Mar 1999 09:30:46 -0500 (EST)
When running egcs-2.92.33 19981226 (gcc2 ss-980609 experimental),
I don't get a warning when I compile this code:
class A {
public:
virtual void func() const;
};
class B : public A {
public:
virtual void func();
};
According to Scott Meyers' 2nd edition "Effective C", item 48
suggests that a warning should be telling the user that
func() delared in A has not been redeclared in B; it's been
hidden entirely. Looks like a common programming mistake that
could have been caught by the compiler. Perhaps a warning
should be issued when -Wall is used???
Steve Hite
sch@southeast.net