gcc 2.95.2 does not allow explicit template parameters in function declaration of partial specialization.

Gabriel Dos Reis Gabriel.Dos-Reis@cmla.ens-cachan.fr
Tue Jan 4 20:57:00 GMT 2000


llewelly@198.dsl.xmission.com writes:

| [1  <text/plain; US-ASCII (7bit)>]
| template<typename T0,typename T1>
|   void foo();
| 
| template<typename T0>
|   void foo<T0,int>();

[...]

| function_template_specialization_bug.cc:5: template-id `foo<T0, int>'
| in declaration of primary template 

G++ is right?

| 
| Section 14.8.1 paragraph 2 implies that this is allowed.

Really?

14.8.1/2:

  A template argument list may be specified when referring to a
  specialization of a template function
  -- when a function is called,
  -- when the address of a function is taken, when a function
     initializes a reference to function, or when a pointer to member
     function is formed,
  -- in an explicit specialization,
  -- in a friend declaration.

  Trailing tmeplate arguments that can be deduced (14.8.2) may be
  omitted from the list of explicit template-arguments. If all of the
  template arguments can be deduced, they may all be omitted, in this
  case, the emppty argument list <> itself may also be omitted.


-- Gaby


More information about the Gcc-bugs mailing list