This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/2752: template function is not instantiated
- To: nobody at gcc dot gnu dot org
- Subject: Re: c++/2752: template function is not instantiated
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: 7 May 2001 08:56:00 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Phil Edwards <pedwards at disaster dot jaj dot com>
The following reply was made to PR c++/2752; it has been noted by GNATS.
From: Phil Edwards <pedwards@disaster.jaj.com>
To: peters@igpm.rwth-aachen.de
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/2752: template function is not instantiated
Date: Mon, 7 May 2001 03:28:38 -0400
On Mon, May 07, 2001 at 08:16:01AM -0000, Peters wrote:
> It comes down to the question, whether the compiler should be able to
> deduce the template-argument SIZE of the_bug from a function-argument,
> in which SIZE is a template-argument of an *enclosing* class.
> (Note, that if one explicitly calls the_bug<10>, as in line X, the code
> compiles fine. )
>
> After browsing through Section 18.4.2 of the C++-Standard, I believe
> that compilers do not need to be able to perform this deduction, so the
> described problem is probably not a bug in gcc.
What a relief; I had just spent twenty minutes deciphering 14.8.2 and came
to the same conclusion. :-) Specifically, [14.8.2.4]/14 seems to address
this situation. The template argument ("<10>" here) must be explicitly
specified, or deduced elsewhere, and I don't think it can be deduced in
this context.
Does this help, florin?
Phil
--
pedwards at disaster dot jaj dot com | pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools. Fools are protected by more capable fools.