c++/9127: Misleading diagnostic for missing template<> introducing specialization

Giovanni Bajo giovannibajo@libero.it
Fri May 2 18:29:00 GMT 2003


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



More information about the Gcc-bugs mailing list