This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

-Wall addition to g++?





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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]