This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9127: Misleading diagnostic for missing template<> introducing specialization
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: <gcc-gnats at gcc dot gnu dot org>,<gcc-bugs at gcc dot gnu dot org>,<nobody at gcc dot gnu dot org>,<gcc-prs at gcc dot gnu dot org>,<schmid at snake dot iap dot physik dot tu-darmstadt dot de>
- Date: Fri, 2 May 2003 20:29:05 +0200
- Subject: Re: c++/9127: Misleading diagnostic for missing template<> introducing specialization
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9127
Well, the problem is that the compiler is entering an instantiation
recursion which should be terminated by the explicit specialization. Since
the spiecialization is invalid (and skipped by the compiler), the loop never
ends.
The problem about the too long output is already covered by c++/9335. So, I
keep this PR open only because the diagnostic of 3.4 could be improved:
-----------------------------------
template <int>
struct A;
struct A<0>
{};
-----------------------------------
pr9127.cpp:5: error: too few template-parameter-lists
The same code snippet on Comeau gives:
"pr9127.cpp", line 4: error: specializing class "A<0>" without "template<>"
syntax is nonstandard
which is _far_ better.
Giovanni Bajo