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]

Re: 19980824 member template specialization bugs?


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



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