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 parameter omission msg (not really a bug)


Hello. This snippet doesn't compile:

template <class X>
struct foo {
	void bar();
};

template <class X>
void
foo::bar()
{
}


which is right since the definition of foo::bar should be:

template <class X>
void
foo<X>::bar()
{
}

However, the message gcc gives states that there is a "syntax error 
before ::", which is rather vague. It would be better if this kind of 
common error is detected and a more appropriate message given. I know, 
this should be worked on, but I saw that a similar work has been done 
when templated parameter in a template ends with operator ">>" instead 
of the space-seperated "> >"...

thanks,

	stef


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