[Bug c++/35192] New: Base method overloading hides base public method in derived class.
gaysinsky at google dot com
gcc-bugzilla@gcc.gnu.org
Thu Feb 14 07:43:00 GMT 2008
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
More information about the Gcc-bugs
mailing list