This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 2.95.2 does not allow explicit template parameters in function declaration of partial specialization.
- To: llewelly at 198 dot dsl dot xmission dot com
- Subject: Re: gcc 2.95.2 does not allow explicit template parameters in function declaration of partial specialization.
- From: Gabriel Dos Reis <Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr>
- Date: 05 Jan 2000 05:56:43 +0100
- Cc: bug-gcc at gnu dot org
- Organization: CMLA, ENS Cachan -- CNRS URA 1611 (France)
- References: <Pine.LNX.4.10.10001041959440.1082-101000@198.dsl.xmission.com>
- Reply-To: bug-gcc at gnu dot org
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