From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8627 invoked by alias); 25 Mar 2002 10:26:12 -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 8600 invoked by uid 71); 25 Mar 2002 10:26:09 -0000 Date: Mon, 25 Mar 2002 02:26:00 -0000 Message-ID: <20020325102609.8599.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Kretschel Klaus Subject: Re: c++/6023: [parser] wrong lookup on templated code Reply-To: Kretschel Klaus X-SW-Source: 2002-03/txt/msg00915.txt.bz2 List-Id: The following reply was made to PR c++/6023; it has been noted by GNATS. From: Kretschel Klaus To: nathan@gcc.gnu.org, Klaus.Kretschel@dlr.de, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/6023: [parser] wrong lookup on templated code Date: Mon, 25 Mar 2002 11:24:04 +0100 --------------019051F0024079775D80B423 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit nathan@gcc.gnu.org wrote: > Old Synopsis: Valid template code does not compile > New Synopsis: [parser] wrong lookup on templated code > > State-Changed-From-To: open->suspended > State-Changed-By: nathan > State-Changed-When: Sun Mar 24 06:06:25 2002 > State-Changed-Why: > The code is not well formed, but g++ makes a right cock > up of it. I've attached an amended test case which I > hope helps. you need to say > h->template foo (...) > as h is a dependant type. We can't lookup foo until > instantiation time, so you must explicitly say that it > will be a template. the reason 'calc' succeeds is that > there is a template of that name in scope, and g++ finds > that during parsing (in error) -- at instantiation time > the right things happen > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6023 Thank you, that's fine. Now that I knew where to look I found it in my Stroustrup. He also explains why it gives a simple parse error, so I guess g++'s message is okay. But nobody's never seen this syntax in our department before - I guess, few people have. Klaus --------------019051F0024079775D80B423 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit nathan@gcc.gnu.org wrote:
Old Synopsis: Valid template code does not compile
New Synopsis: [parser] wrong lookup on templated code

State-Changed-From-To: open->suspended
State-Changed-By: nathan
State-Changed-When: Sun Mar 24 06:06:25 2002
State-Changed-Why:
    The code is not well formed, but g++ makes a right cock
    up of it. I've attached an amended test case which I
    hope helps. you need to say
        h->template foo<args> (...)
    as h is a dependant type. We can't lookup foo until
    instantiation time, so you must explicitly say that it
    will be a template. the reason 'calc' succeeds is that
    there is a template of that name in scope, and g++ finds
    that during parsing (in error) -- at instantiation time
    the right things happen

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6023

Thank you, that's fine. Now that I knew where to look I found it in my Stroustrup. He also
explains why it gives a simple parse error, so I guess g++'s message  is okay. But nobody's never
seen this syntax in our department before - I guess, few people have.

Klaus --------------019051F0024079775D80B423--