From 99ea7343ce6d23157427a59eaf969596e8ed609f Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 15 Oct 2010 01:15:58 +0000 Subject: [PATCH] When we are missing the ',' or '>' to terminate a template parameter list, complain about it! Fixes PR7053. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116551 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Parse/ParseTemplate.cpp | 2 +- test/Parser/cxx-template-decl.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index dfb4785489..8142cd226b 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -337,7 +337,7 @@ Parser::ParseTemplateParameterList(unsigned Depth, // subsumed by whatever goes on in ParseTemplateParameter. // TODO: This could match >>, and it would be nice to avoid those // silly errors with template >. - // Diag(Tok.getLocation(), diag::err_expected_comma_greater); + Diag(Tok.getLocation(), diag::err_expected_comma_greater); SkipUntil(tok::greater, true, true); return false; } diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp index 3a97efac19..4717dbb7dc 100644 --- a/test/Parser/cxx-template-decl.cpp +++ b/test/Parser/cxx-template-decl.cpp @@ -6,7 +6,9 @@ template x; // expected-error {{C++ requires a type specifier for al // expected-error {{does not refer}} export template x; // expected-error {{expected '<' after 'template'}} export template class x0; // expected-warning {{exported templates are unsupported}} -template < ; // expected-error {{parse error}} expected-warning {{declaration does not declare anything}} +template < ; // expected-error {{parse error}} \ +// expected-error{{expected ',' or '>' in template-parameter-list}} \ +// expected-warning {{declaration does not declare anything}} template