This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/2752
- To: nobody at gcc dot gnu dot org
- Subject: Re: c++/2752
- From: Peters <peters at igpm dot rwth-aachen dot de>
- Date: 7 May 2001 08:16:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Peters <peters at igpm dot rwth-aachen dot de>
The following reply was made to PR c++/2752; it has been noted by GNATS.
From: Peters <peters@igpm.rwth-aachen.de>
To: florin@iucha.net, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Cc:
Subject: Re: c++/2752
Date: Mon, 07 May 2001 10:18:34 +0200
Hi,
here is a shortened version of the code-snippet in question:
template<int SIZE>
class B
{
public:
class P {};
};
template<int SIZE>
void the_bug(B<SIZE>::P p)
{}
void test()
{
// the_bug<10>(B<10>::P()); // line X, compiles
the_bug(B<10>::P()); // line Y
}
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.
Best regards,
Joerg Peters
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2752&database=gcc