This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6023: [parser] wrong lookup on templated code
- From: nathan at gcc dot gnu dot org
- To: Klaus dot Kretschel at dlr dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 24 Mar 2002 14:06:25 -0000
- Subject: Re: c++/6023: [parser] wrong lookup on templated code
- Reply-to: nathan at gcc dot gnu dot org, Klaus dot Kretschel at dlr dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
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