Code example:

class Base {
 public:
  void g(int i) {}

 protected:
  virtual void g(int i, int j) {}
};


class Derived : public Base {
 protected:
  virtual void g(int i, int j) {}
};


int main() {
  Derived o;
  o.g(5);
  return 0;
}

Compilation output:
dos/quotas/test.cc: In function 'int main()':
dos/quotas/test.cc:18: error: no matching function for call to
'Derived::g(int)'
dos/quotas/test.cc:12: note: candidates are: virtual void Derived::g(int, int)


-- 
           Summary: Base method overloading hides base public method in
                    derived class.
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gaysinsky at google dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35192

Reply via email to