This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Template function problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]