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: Combining overloading with inheritence


Carsten WEICH wrote:

> Is this a compiler bug or do I understand C++ rules wrong?
> Please answer to cweich@frequentis.com, as I am not subscribed
> to this mailing list.
You misunderstand C++. Essentially the rule is 'search the class heirarchy and
stop at the first class that declares an 'M'. This is C1 in your example. Then
perform overload resolution on what is found. So C::M is never considered. If
you want to consider C::M, you need a using directive in C1, but unfortunately
egcs++ does not yet support such a using directive (it does support some using
directives).

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
      You can up the bandwidth, but you can't up the speed of light      
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk


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