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: EGCS


> I had submitted a request similar to the one given below on your newsgroup 
> sometime ago. I was wondering if it was possible for someone to let me know
> if a fix for this might be coming sometime. Please do let me know.

Thanks for your report. Please have a look at
http://egcs.cygnus.com/bugs.html

(heading Using declarations in classes do not work). This is an old
bug, and it is unlikely to get fixed anytime soon.

>     // If you uncomment the following 2 lines you get the workaround for
>     // the problem.
>     // virtual void Print(X x) { A::Print(x); }
>     // virtual void Print(Y y) { A::Print(y); }
>     virtual void Print(Z z) { cout << "The value of Z = " << z << endl; }

Meanwhile, the work-around you mention is the best thing you can do.
Please note that you don't have to make the functions virtual. If you
don't, the compiler will inline the calls to the base methods, so you
don't pay any runtime overhead for this work-around - only additional
source code.

Hope this helps,
Martin


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