This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]