From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2044 invoked by alias); 5 Jun 2012 11:54:10 -0000 Received: (qmail 2035 invoked by uid 22791); 5 Jun 2012 11:54:09 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Jun 2012 11:53:56 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53573] template type dependent name resolution broken Date: Tue, 05 Jun 2012 11:54: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-06/txt/msg00243.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573 --- Comment #16 from Keean Schupke 2012-06-05 11:53:32 UTC --- (In reply to comment #14) Basic.lookup.argdep is not specific to templates, so why does the dependent lookup work outside of templates? int g(int x) { return x - 1; } double g(double x) { return x + 1.0L; } main() { int x(g(1.0L)); } why does ADL work here if [basic.lookup.argdep] means what you imply? > [temp.dep.res] says dependent name resolution considers declarations visible at > the point of definition, and declarations from associated namespaces from the > instantiation context and the definition context. > > [basic.lookup.argdep]/2 says "If T is a fundamental type, its associated sets > of namespaces and classes are both empty." --- Comment #17 from Jonathan Wakely 2012-06-05 11:53:55 UTC --- (In reply to comment #13) > double dd; > void h() > { > g(2); // will cause one call of f(char) followed > // by two calls of f(int) > g('a'); // will cause three calls of f(char) > } > > > > So it was like this in 1998, and it is the same in the latest working draft. (Please stop quoting large chunks of copyrighted documents.) No it isn't the same, the example above was incorrect and different in C++11, see DR 197: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#197