This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: 19980824 member template specialization bugs?
- To: "Reid M. Pinchback" <reidmp at MIT dot EDU>
- Subject: Re: 19980824 member template specialization bugs?
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 01 Sep 1998 23:52:07 -0300
- Cc: egcs-bugs at cygnus dot com
- References: <2.2.32.19980831161249.00e925ec@po9.mit.edu>
Reid M Pinchback <reidmp@MIT.EDU> writes:
> The specialization syntax can get a bit non-intuitive so
> I've tried verifying this against the CD2 docs, but I'll admit
> to going a bit cross-eyed in the process of attempting that. :-)
> Have I missed something syntactically obvious?
Yup. The error messages could certainly be improved, but it seems to
me that you can only declare template explicit specializations in
namespace scope, not in class scope [temp.expl.spec]/2
Furthermore, you can only explicitly specialize a template member if
the containing class is fully specialized too. [temp.expl.spec]/17-18
BTW, as I tried to modify your test case so that it would compile, I
found out that the following code snippet will cause an ICE in
egcs-1.1: Mark? Jason? Should I install it in the testsuite?
template <class X> class bug { template <class Y> class a {}; };
template <class X> template <> class bug<X>::a<char> {};
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil