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]

Re: Hi bugmakers



it was next sample:
class A {
        public :
    virtual int func ( int, int ) ;
    virtual int func ( int ) ;
} ;

class B : public A {
        public :
    int func ( int ) ;
} ;

main () {
    B b ;
    b.func ( 0, 0 ) ;
}


> Ok, I compile this with egcs-2.93.08, and get
> 
> a.cc:14: no matching function for call to `B::func (int, int)'
> a.cc:9: candidates are: B::func(int)
> 
> Looking at code, I see that the compiler is right, and your code is
> wrong. Now what, bugmaker?

There is something wrong in my code ?
Base class has two virtual functions with diffrent parametrs, and
  in overloading on of them, i lost second.... is it ok ?

class A {
	public :
    int a ( int ) ;
} ;
class B {
	public :
} ;
main () {
  B b ;
  b.a() ;
}

There is no function B::a(int) but compiler did`nt say it. :)
And correct me if me wrong: you have no diffrence between func(int) and 
func(int,int) in overloading ?

Thanks for answer. I`ll be waiting.
Best regards.



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