From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13592 invoked by alias); 3 Feb 2003 19:56:01 -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 13565 invoked by uid 71); 3 Feb 2003 19:56:01 -0000 Date: Mon, 03 Feb 2003 19:56:00 -0000 Message-ID: <20030203195601.13562.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Wolfgang Bangerth Subject: Re: c++/9549: [3.4 regression] [New parser] ICE in regenerate_decl_from_template Reply-To: Wolfgang Bangerth X-SW-Source: 2003-02/txt/msg00139.txt.bz2 List-Id: The following reply was made to PR c++/9549; it has been noted by GNATS. From: Wolfgang Bangerth To: Martin Sebor Cc: gcc-gnats@gcc.gnu.org, Subject: Re: c++/9549: [3.4 regression] [New parser] ICE in regenerate_decl_from_template Date: Mon, 3 Feb 2003 13:46:33 -0600 (CST) > >>This syntax is required only if the right hand side of the > ^^^^^^^^^^^^^^^ > > I meant left hand side here, not right hand side. Sorry. > > >>dot operator depends on a template parameter, otherwise it > >>is optional. Please read 14.2, p4 for more. > > > > > > Ehm, but in m.do_it, the rhs of the dot operator _is_ template > > dependent, no? 14.2.4 has almost the same example and says that you need > > the template keyword -- what am I missing here? > > If the left hand side does not depend on a template parameter, > there is no reason to use the template prefix since the name > to the right of the dot is known to either be a template or > not at the point of parsing the "surrounding" template and > there is no possibility of an ambiguity with the less than > operator. Otherwise it may or may not be a template, and the > first "<" may or may not be a less than operator, depending > on any specializations of the template to the left of the > dot operator. > > For instance, [...] I understand the reasoning for the necessity of the "template" keyword here. This is 14.2.4 text and example from the 1997 draft I use: When the name of a member template specialization appears after . or -> in a postfix-expression, or after :: in a qualified-id that explic- itly depends on a template-argument (_temp.dep_), the member template name must be prefixed by the keyword template. Otherwise the name is assumed to name a non-template. [Example: class X { public: template X* alloc(); }; void f(X* p) { X* p1 = p->alloc<200>(); // ill-formed: < means less than X* p2 = p->template alloc<200>(); // fine: < starts explicit qualification } --end example] Clearly, the lhs is not template-dependent. Has this been changed afterwards? That might explain our mismatch!? W. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth/