Specialization in templates

Joe Buck jbuck@synopsys.com
Fri Oct 30 13:42:00 GMT 1998


> 
> Matthias Seeger <un9i@rz.uni-karlsruhe.de> writes:
> 
> > template<class T> class A<T*> { };
> 
> > my EGCS compiler stops with "parse error before <'"
> 
> And it is correct.  

Yes, but ideally the compiler would give a better error message for
this case, one that would help the user more.

> > Does this mean that templete specialization (Stroustrup, 3rd ed.,
> > p.341) is not yet supported by EGCS?
> 
> Nope; specialization is supported, but, in order to specialize a
> template, you must first declare it.

Maybe some sort of error recovery pattern could be added that would
recognize that this is an attempt to specialize a template that has
not been declared.




More information about the Gcc mailing list