In this case:
class A
{
public:
int f() {return 2;}
};
class B : public A
{
public:
int f(int e) {return e;}
};
int main (void)
{
B test;
test.f();
}
I got an error while the A::f() method should be accessible without any
problem:
test.cc: In function ‘int main()’:
test.cc:16: error: no matching function for call to ‘B::f()’
test.cc:10: note: candidates are: int B::f(int)
However if the A::f() function have at least one parameter and B::f() more than
one, i don't have any errors.
Regards,
--
Summary: Can't access to a herited method
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: titou at ap2c dot com
GCC host triplet: i686
GCC target triplet: i686
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25640