public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Kretschel Klaus <Klaus.Kretschel@dlr.de> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/6023: [parser] wrong lookup on templated code Date: Mon, 25 Mar 2002 02:26:00 -0000 [thread overview] Message-ID: <20020325102609.8599.qmail@sources.redhat.com> (raw) 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> The code is not well formed, but g++ makes a right cock <br> up of it. I've attached an amended test case which I <br> hope helps. you need to say <br> h->template foo<args> (...) <br> as h is a dependant type. We can't lookup foo until <br> instantiation time, so you must explicitly say that it <br> will be a template. the reason 'calc' succeeds is that <br> there is a template of that name in scope, and g++ finds <br> that during parsing (in error) -- at instantiation time <br> 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&database=gcc&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 is okay. But nobody's never <br>seen this syntax in our department before - I guess, few people have. <p>Klaus</html> --------------019051F0024079775D80B423--
next reply other threads:[~2002-03-25 10:26 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-03-25 2:26 Kretschel Klaus [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-03-24 6:06 nathan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020325102609.8599.qmail@sources.redhat.com \ --to=klaus.kretschel@dlr.de \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).