diff options
Diffstat (limited to 'test/Parser/cxx-template-decl.cpp')
-rw-r--r-- | test/Parser/cxx-template-decl.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp index 4717dbb..7e931a3 100644 --- a/test/Parser/cxx-template-decl.cpp +++ b/test/Parser/cxx-template-decl.cpp @@ -6,15 +6,20 @@ 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}} \ +template < ; // expected-error {{expected template parameter}} \ // expected-error{{expected ',' or '>' in template-parameter-list}} \ // expected-warning {{declaration does not declare anything}} +template <int +> struct x1; // expected-error {{expected ',' or '>' in template-parameter-list}} + +// verifies that we only walk to the ',' & still produce errors on the rest of the template parameters +template <int +, T> struct x2; // expected-error {{expected ',' or '>' in template-parameter-list}} \ + expected-error {{expected unqualified-id}} +template<template<int+>> struct x3; // expected-error {{expected ',' or '>' in template-parameter-list}} \ + expected-error {{template template parameter requires 'class' after the parameter list}} template <template X> struct Err1; // expected-error {{expected '<' after 'template'}} \ // expected-error{{extraneous}} -template <template <typename> > struct Err2; // expected-error {{expected 'class' before '>'}} \ -// expected-error{{extraneous}} -template <template <typename> Foo> struct Err3; // expected-error {{expected 'class' before 'Foo'}} \ -// expected-error{{extraneous}} +template <template <typename> > struct Err2; // expected-error {{template template parameter requires 'class' after the parameter list}} +template <template <typename> Foo> struct Err3; // expected-error {{template template parameter requires 'class' after the parameter list}} // Template function declarations template <typename T> void foo(); |