This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]