]> granicus.if.org Git - clang/commitdiff
When we are missing the ',' or '>' to terminate a template parameter
authorDouglas Gregor <dgregor@apple.com>
Fri, 15 Oct 2010 01:15:58 +0000 (01:15 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 15 Oct 2010 01:15:58 +0000 (01:15 +0000)
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
test/Parser/cxx-template-decl.cpp

index dfb4785489d04fa01295ff6a883d1eb95d201554..8142cd226b5c92e18d1c8270b1fbb68b2021817a 100644 (file)
@@ -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 <vec<T>>.
-      // Diag(Tok.getLocation(), diag::err_expected_comma_greater);
+      Diag(Tok.getLocation(), diag::err_expected_comma_greater);
       SkipUntil(tok::greater, true, true);
       return false;
     }
index 3a97efac19ed45076966d71a918afa6096d1982b..4717dbb7dc2d396c4d2790a984b300def2550ea7 100644 (file)
@@ -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 T> 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 <template X> struct Err1; // expected-error {{expected '<' after 'template'}} \
 // expected-error{{extraneous}}
 template <template <typename> > struct Err2;       // expected-error {{expected 'class' before '>'}} \