This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Combining overloading with inheritence
- To: Carsten WEICH <CWeich at frequentis dot com>
- Subject: Re: Combining overloading with inheritence
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Tue, 02 Mar 1999 19:14:46 +0000
- CC: egcs-bugs at egcs dot cygnus dot com, Carsten WEICH <CWeich dot POMEI1 dot FRQMEI at frequentis dot com>
- Organization: University of Bristol
- References: <s6dc3404.061@mail.frequentis.com>
- Reply-To: nathan at compsci dot bristol dot ac dot uk
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