From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22578 invoked by alias); 11 Dec 2002 15:16:06 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 22564 invoked by uid 71); 11 Dec 2002 15:16:05 -0000 Date: Wed, 11 Dec 2002 07:16:00 -0000 Message-ID: <20021211151605.22563.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Nathan Sidwell Subject: Re: c++/8821: gcc 3.2 problem with overloaded inherited operator Reply-To: Nathan Sidwell X-SW-Source: 2002-12/txt/msg00630.txt.bz2 List-Id: The following reply was made to PR c++/8821; it has been noted by GNATS. From: Nathan Sidwell To: Wolfgang Bangerth Cc: andre@kiwisound.de, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/8821: gcc 3.2 problem with overloaded inherited operator Date: Wed, 11 Dec 2002 15:15:11 +0000 Wolfgang Bangerth wrote: >andre wrote >>In my opinion it IS a bug because the operator of the parent class has >>another argument. So the name resolution should detect the matching >>operator in the parent class as usual in C++. I think overloaded >>operators should behave like overloaded functions (where the same thing >>works!). please post such code. It should not behave how you describe. > Note the distinction I made between overloaded functions and overloaded > virtual functions. For some historical reason, a virtual function with a > different argument list hides a function with the same name in the base > class. This is not the case for non-virtual functions. I just don't know hm, yes it is the same. > how operators behave. That's the question here. I concede that the > behavior is confusing. First name lookup happens, once a name has been found, base classes are not searched. Then overload resolution happens then accessibility is checked This happens consistently regardless of virtuality or operatorness nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC The voices in my head told me to say this nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org