This is the mail archive of the gcc-patches@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: PATCH for error-recovery on bad member-template declarations


>>>>> "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


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