This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH for error-recovery on bad member-template declarations
- To: oliva at dcc dot unicamp dot br
- Subject: Re: PATCH for error-recovery on bad member-template declarations
- From: Mark Mitchell <mark at markmitchell dot com>
- Date: Tue, 22 Sep 1998 16:23:29 -0700
- CC: egcs-patches at cygnus dot com, jason at cygnus dot com
- References: <199809221900.MAA08456@smtp.earthlink.net> <oraf3r7ol6.fsf@araguaia.dcc.unicamp.br>
- Reply-to: mark at markmitchell dot com
>>>>> "Alexandre" == Alexandre Oliva <oliva@dcc.unicamp.br> writes:
Alexandre> Mark Mitchell <mark@markmitchell.com> writes:
>> template <class A, class B> void foo(); template <class C>
>> class bar { int i; ! template <class B> friend void
>> foo<C,B>(); // ERROR - bogus declaration };
Alexandre> Can you support this claim? I couldn't find any
Alexandre> indication that this is valid or invalid in the
Alexandre> Standard :-(
Thought we already went around on this. There is no such thing as
partial specialization of function templates, which is essentially
what this is. To make any sense there would have to be some template:
template <class X, class Y> void foo();
but then the thing you wrote would be a partial specialization of it.
It certainly can't be a legal primary template because of:
14.5 Template declarations [temp.decls]
1 A template-id, that is, the template-name followed by a template-argu-
ment-list shall not be specified in the declaration of a primary tem-
plate declaration.
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com