This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Template function problem
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: Template function problem
- From: "Oakham, Geoff" <Geoff dot Oakham at cognos dot com>
- Date: Thu, 15 Jun 2000 14:41:00 -0400
Hi,
I'm having a problem declaring a template function.. this is the simplest
case I could make:
---sample.cpp---
template <class _myK>
void sample_function (_myK a)
{
_myK::q blah;
return;
}
--end sample.cpp--
which looks valid to me.. and yet:
$ g++ -c sample.cpp -o sample.o
sample.cpp: In function `void sample_function(_myK)':
sample.cpp:4: parse error before `;'
It compiles on a couple other compilers without error, and I can't find
anything in the ARM that forbids it.. so I'm a little confused.
That sample code was on compiled on gcc version egcs-2.91.66 1990314/Linux
(egcs-1.1.2 release). I've also tried it on a more recent version of gcc,
but with the same results.
Any hints would be much appreciated,
thanks,
Geoff