This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3634: partial specialization envolving nested classes is broken
- From: Ewgenij Gawrilow <gawrilow at math dot TU-Berlin dot DE>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: lerdsuwa at gcc dot gnu dot org
- Date: Mon, 19 Nov 2001 10:12:08 +0100 (MET)
- Subject: Re: c++/3634: partial specialization envolving nested classes is broken
[Get raw message]
>
> Synopsis: partial specialization envolving nested classes is broken
>
> State-Changed-From-To: open->closed
> State-Changed-By: lerdsuwa
> State-Changed-When: Sat Nov 17 00:44:13 2001
> State-Changed-Why:
> Not a bug. typename outer<T>::inner is a non-deduce context.
> The compiler is not allowed to deduce that 'T' is 'int'. So
> the partial specialization is never used by gcc.
>
Sorry, I can't agree with this argumentation. There is nothing to deduce
here. The only thing the compiler has to check is whether the template
argument is a local class `inner' of ANY instance of a given template class
`outer'. I think, this could be done without any type deduction,
since the internal description of `inner' surely contains some kind
of reference to its containing class.
If you forbid partial specializations for local classes, how should
we write traits classes for iterators, which are most naturally defined
as local classes of their containers?
With best regards,
Ewgenij Gawrilow