Bug 33121 - Problem when deriving methods from a class with same name but different argments
Summary: Problem when deriving methods from a class with same name but different argments
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.2
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-20 13:07 UTC by Andreas Pietzowski
Modified: 2007-08-20 13:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Pietzowski 2007-08-20 13:07:25 UTC
Hello,

I have the classes A and B where B is derived from A. The following methods are given:

bool A::method();
virtual bool A::method(int arg);

bool B::method(int);

Now when I want to call method() on an object of type B I get the compiler error that there is no method() in class B and the only candidate is method(int). Is this my fault with some GCC options or is this really a bug?

Thanks for looking into it.
Andreas
Comment 1 Andrew Pinski 2007-08-20 13:54:42 UTC
struct A
{
  virtual int method(int);
  int method();
};

struct B: A
{
  int method(int);
};

That is the example.  You need to add:
using A::method;

to get exposed in B, A::method.