From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28039 invoked by alias); 1 Aug 2014 11:27:33 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27998 invoked by uid 55); 1 Aug 2014 11:27:28 -0000 From: "gaoyuanming at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61987] Name Resolution within a Template Date: Fri, 01 Aug 2014 11:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gaoyuanming at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-08/txt/msg00034.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61987 --- Comment #7 from Yuanming Gao --- Please read the book: <>. The code comes from <<7.1 Templates>>. The author thought the function int foo(int) must be selected. Visual C++ can select the int foo(int) correctly. I don't know whether it is an implementation issue, or it is by design. Best regards, Yuanming > From: gcc-bugzilla@gcc.gnu.org > To: gaoyuanming@hotmail.com > Subject: [Bug c++/61987] Name Resolution within a Template > Date: Fri, 1 Aug 2014 10:28:36 +0000 > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61987 > > --- Comment #5 from Jonathan Wakely --- > G++ and clang++ call f(double) four times, because that is the only function > visible in the template definition. foo(int) is only visible at the point of > instantiation, so could only be found by ADL, but int has no associated > namespaces. > > EDG does call foo(int) twice, and fails to compile because the call with > unsigned long argument could call foo(double) or foo(int) and so is ambiguous. > > So either the code never calls foo(int) or the code doesn't compile! > > -- > You are receiving this mail because: > You reported the bug.