This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Is this right, or a bug?
- From: Nick Glencross <nickg at glencros dot demon dot co dot uk>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 28 Feb 2004 20:17:13 +0000
- Subject: Is this right, or a bug?
Hi Guys,
I'm not sure if this is right or not. I've checked through
http://gcc.gnu.org/bugs.html#cxx and can't see this listed.
What I've got boils down to is shown in the following example. Even
though 'method(int a)' is defined in 'class1', it isn't available in
'main' through 'class2'. There's a compiler error saying that 'method
(int)' doesn't exist, only 'method ()'.
Changing 'method' to 'method2' in the lines highlighted, the problem
goes away.
This makes me think that the clash with the virtual method is breaking
things. Anyone know what is going ok?
Cheers,
Nick Glencross
========================================
// Abstract Baseclass
class class1
{
public:
virtual void method (void) = 0;
void method (int a) {} // If method2, this is ok
};
// Concrete Class
class class2 : public class1
{
public:
void method (void) {} // If method2, this is ok
};
// Test
int main()
{
class2 a;
a.method (12); // If method2, this is ok
}