[Bug c++/36203] explicit member function template lookup fails from templated function
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat May 10 23:02:00 GMT 2008
------- 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
More information about the Gcc-bugs
mailing list