From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25955 invoked by alias); 22 Dec 2003 16:36:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25944 invoked by uid 48); 22 Dec 2003 16:36:31 -0000 Date: Mon, 22 Dec 2003 16:51:00 -0000 Message-ID: <20031222163631.25943.qmail@sources.redhat.com> From: "nathan at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20030419003600.10437.dean@foster.net> References: <20030419003600.10437.dean@foster.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/10437] "using namespace" at global scope creates incorrect code X-Bugzilla-Reason: CC X-SW-Source: 2003-12/txt/msg02376.txt.bz2 List-Id: ------- Additional Comments From nathan at gcc dot gnu dot org 2003-12-22 16:36 ------- Ok, First point1. Do using declarations work retroactively in this regard. For a dependent name, the answer is yes, sort of. [14.6.4] lists the places you look to resolve a dependent name, and they are 1) declarations that are visible at the point of definition of the template 2) declarations from namespaces associated with the type of the function arguments both from the instantiation context and from the definition context. That 2nd part is an amalgamated koenig lookup. In this case the type is int, so has no associated namespaces, and hence adds nothing to the overload set. Thus, I believe instantiation of bar will give an unresolved call for foo. Now the second point. This a case of SFINAE failure, no diagnostic should be issued. The call of foo in bar must resolve to ::foo(int), as the other posibility ::foo(const int &) gives a substitution failure. The EDG compiler accepts this code. -- What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|nathan at gcc dot gnu dot |unassigned at gcc dot gnu |org |dot org Status|ASSIGNED |NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10437