c++/7033: [3.3/3.4 regression] [2003-05-30] Partial template specializations accepted even if a template parameter is used in a non-deduced context
Theodore Papadopoulo
Theodore.Papadopoulo@sophia.inria.fr
Tue May 6 18:35:00 GMT 2003
giovannibajo@libero.it said:
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7033
> The specialization should not be selected because §14.8.2.4p4 clearly
> specifies that A<T>::B<Q> is a non-deduced context for both T and Q.
> But there's more: I'm confident that defining a partial template
> specialization whose arguments can't be fully deduced from the
> arguments of the original template is ill-formed.
I kindly disagree.
First §14.8.2.4p4 deals with "Function template specializations" not
with "Class template specializations". The program might be invalid
but not for this reason.
Second, the specialization can fully be deduced from the template
arguments (look again), so that your second affirmation is equally
wrong. Both T and V are given in the instanciation.
Actually, looking at the standard with Gaby today, it looks like that
by §14.5.4.1p1, the unique specialization exactly matched by all the
template parameters (which is the case here) should be selected....
I do not definitely claim that the example should compile because I
do not know all the arcanes of the standard with this respect, but I
have not yet seen an argument that forbids it. And moreover,
forbidding this would be extremely surprising for the users without a
proper message explaining the reasons for that...
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------
More information about the Gcc-bugs
mailing list