This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Specialization in templates
- To: oliva at dcc dot unicamp dot br (Alexandre Oliva)
- Subject: Re: Specialization in templates
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Fri, 30 Oct 98 9:18:23 PST
- Cc: un9i at rz dot uni-karlsruhe dot de, egcs at cygnus dot com
>
> 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.