From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24683 invoked by alias); 1 Feb 2002 13:16:11 -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 24636 invoked by uid 71); 1 Feb 2002 13:16:07 -0000 Date: Fri, 01 Feb 2002 05:16:00 -0000 Message-ID: <20020201131607.24632.qmail@sources.redhat.com> To: jason@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Jason Merrill Subject: Re: c++/2127: namespace problems Reply-To: Jason Merrill X-SW-Source: 2002-02/txt/msg00009.txt.bz2 List-Id: The following reply was made to PR c++/2127; it has been noted by GNATS. From: Jason Merrill To: Reichelt Cc: gcc-gnats@gcc.gnu.org Subject: Re: c++/2127: namespace problems Date: Fri, 01 Feb 2002 13:07:38 +0000 >>>>> "Reichelt" == Reichelt writes: >> This is not a bug. The candidates considered for the == expression in dummy >> are those visible at the point of definition of dummy (only the S1 >> version) and those in the associated namespace of S2 (also only >> the S1 version). You must move the S2 version into the namespace. > I'm not quite convinced, because the code compiles fine, if you remove > the first version of the == operator (the S1-version inside the > namespace). According to your explanation the code shouldn't compile > in this case. No, it shouldn't, but g++ doesn't implement 2-phase name lookup properly. > The only thing that might be possible IMHO is that the definition > outside the namespace is shadowed by the one inside That is indeed what is happening in g++ currently. It does a normal lookup in the scope of the function, which finds the S1 version and stops. Jason