diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-28 15:28:59 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-28 15:28:59 +0000 |
commit | a4ed0d8d75212dc01b4438829a4b0c846d99458d (patch) | |
tree | f72d8fcea1a6e4db4a415065d4e7d0eff5e96c96 /test/Parser/cxx-template-decl.cpp | |
parent | 3c902ced87cd3e9994116485d7f28ca7f58b68e7 (diff) |
Diagnose declarations that don't declare anything, and fix PR3020.
Examples:
int;
typedef int;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-template-decl.cpp')
-rw-r--r-- | test/Parser/cxx-template-decl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp index 53813776e7..79b04cfc79 100644 --- a/test/Parser/cxx-template-decl.cpp +++ b/test/Parser/cxx-template-decl.cpp @@ -5,10 +5,12 @@ export class foo { }; // expected-error {{expected template}} template x; // expected-error {{expected '<' after 'template'}} export template x; // expected-error {{expected '<' after 'template'}} \ // expected-note {{exported templates are unsupported}} -template < ; // expected-error {{parse error}} -template <template X> ; // expected-error {{expected '<' after 'template'}} -template <template <typename> > ; // expected-error {{expected 'class' before '>'}} -template <template <typename> Foo> ; // expected-error {{expected 'class' before 'Foo'}} +// See Sema::ParsedFreeStandingDeclSpec about the double diagnostic. This is +// because ParseNonTypeTemplateParameter starts parsing a DeclSpec. +template < ; // expected-error {{parse error}} expected-error {{declaration does not declare anything}} +template <template X> struct Err1; // expected-error {{expected '<' after 'template'}} +template <template <typename> > struct Err2; // expected-error {{expected 'class' before '>'}} +template <template <typename> Foo> struct Err3; // expected-error {{expected 'class' before 'Foo'}} // Template function declarations template <typename T> void foo(); |