This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/6023: [parser] wrong lookup on templated code


The following reply was made to PR c++/6023; it has been noted by GNATS.

From: Kretschel Klaus <Klaus.Kretschel@dlr.de>
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<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
 Content-Type: text/html; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 <html>
 nathan@gcc.gnu.org wrote:
 <blockquote TYPE=CITE>Old Synopsis: Valid template code does not compile
 <br>New Synopsis: [parser] wrong lookup on templated code
 <p>State-Changed-From-To: open->suspended
 <br>State-Changed-By: nathan
 <br>State-Changed-When: Sun Mar 24 06:06:25 2002
 <br>State-Changed-Why:
 <br>&nbsp;&nbsp;&nbsp; The code is not well formed, but g++ makes a right
 cock
 <br>&nbsp;&nbsp;&nbsp; up of it. I've attached an amended test case which
 I
 <br>&nbsp;&nbsp;&nbsp; hope helps. you need to say
 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h->template foo&lt;args>
 (...)
 <br>&nbsp;&nbsp;&nbsp; as h is a dependant type. We can't lookup foo until
 <br>&nbsp;&nbsp;&nbsp; instantiation time, so you must explicitly say that
 it
 <br>&nbsp;&nbsp;&nbsp; will be a template. the reason 'calc' succeeds is
 that
 <br>&nbsp;&nbsp;&nbsp; there is a template of that name in scope, and g++
 finds
 <br>&nbsp;&nbsp;&nbsp; that during parsing (in error) -- at instantiation
 time
 <br>&nbsp;&nbsp;&nbsp; the right things happen
 <p><a href="http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6023";>http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&amp;database=gcc&amp;pr=6023</a></blockquote>
 Thank you, that's fine. Now that I knew where to look I found it in my
 Stroustrup. He also
 <br>explains why it gives a simple parse error, so I guess g++'s message&nbsp;
 is okay. But nobody's never
 <br>seen this syntax in our department before - I guess, few people have.
 <p>Klaus</html>
 
 --------------019051F0024079775D80B423--
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]