From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30765 invoked by alias); 4 Mar 2005 05:00:35 -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 30360 invoked by uid 48); 4 Mar 2005 05:00:17 -0000 Date: Fri, 04 Mar 2005 05:00:00 -0000 Message-ID: <20050304050017.30359.qmail@sourceware.org> From: "smcpeak at cs dot berkeley dot edu" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20030806091852.11828.benko@sztaki.hu> References: <20030806091852.11828.benko@sztaki.hu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/11828] [3.4/4.0 regression] qualified dependent name looked up too early X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg00477.txt.bz2 List-Id: ------- Additional Comments From smcpeak at cs dot berkeley dot edu 2005-03-04 05:00 ------- I think I have answered my own question: indeed, qualified lookup only considers name from the definition context, and not the instantiation context. I found this thread at google groups: http://groups-beta.google.com/group/comp.std.c++/browse_thread/thread/22521f9b57b995d0/73d79aadca8c665c Quoting from a few of the more useful messages: http://groups-beta.google.com/group/comp.std.c++/msg/ae689cfc9c99262d Moving to templates. Point of definition does both normal and argument dependent lookup, point of instantiation does ADL only (14.6.4/1.) When you disable ADL by writing N::foo(x), the only lookup that remains is normal lookup done at point of definition. Point of instantiation lookup is implicitly disabled as a consequence of the interaction between 3.4.2/1 and 14.6.4/1. http://groups-beta.google.com/group/comp.std.c++/msg/0e252a95da0f453d The OL part happens at the point of definition (phase 1), and the ADL part happens at the POI (point of instantiation; phase 2). If you remove the ADL part, you're left with a phase 1 lookup only. http://groups-beta.google.com/group/comp.std.c++/msg/6a53b35efe39fee3 The compromise that was reached was to say that lexical lookup would occur only in the definition context; only ADL would be performed in the instantiation context. Since qualified function names do not participate in ADL, any arguments in a call to a qualified name are ignored in determining whether a qualified name is dependent or not. The upshot is that, by 14.6.4p1, second-phase lookup *only* does argument-dependent lookup, which is itself disabled by qualification. This has some nasty consequences, e.g. http://groups-beta.google.com/group/comp.std.c++/msg/8379998d36b27a99 but appears to be the genuine intent of the committee. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11828