This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36203] explicit member function template lookup fails from templated function
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 May 2008 23:01:22 -0000
- Subject: [Bug c++/36203] explicit member function template lookup fails from templated function
- References: <bug-36203-7638@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-05-10 23:01 -------
This is not a bug:
template<class TC, int V> int Cx<TC, V>::fx(TC* tc) { return tc->f<V>(); }
You frogot the template keyword. That is the above should be:
template<class TC, int V> int Cx<TC, V>::fx(TC* tc) { return tc->template
f<V>(); }
as tc is dependent, you need to tell the compiler that it will be a template,
otherwise it will try to parse the < as a < that it is parsing it as (tc->f <
V) > () .
Also EDG in strict mode (non GNU extension mode) rejects it as expected.
See also http://gcc.gnu.org/gcc-3.4/changes.html (You must now use the typename
and template keywords to disambiguate dependent names, as required by the C++
standard. ) .
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36203