This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12046] parse error in template 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: 24 Aug 2003 17:54:12 -0000
- Subject: [Bug c++/12046] parse error in template function
- References: <20030824174359.12046.cspiel@freenet.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12046
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-24 17:54 -------
The code is invalid as the template C<Traits<T>::b>::f in any_f is depend on the template
argument T so you need to help the compiler to know that it is a template.
Here is the correct fix:
template<class T> T any_f(T x)
{
return C<Traits<T>::b>::template f<T>(x);
}
Also note you specifications of Traits are wrong, they should have template<> infront of the
structs, also the specifications of C is the same way.
Once these are fixed you can compile your code on the mainline of GCC.