From ec2b103c267a06a66e926f62cd96767b280f5cf5 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 2 Jun 2009 17:58:47 +0000 Subject: Import Clang, at r72732. --- test/Parser/cxx-template-decl.cpp | 82 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 test/Parser/cxx-template-decl.cpp (limited to 'test/Parser/cxx-template-decl.cpp') diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp new file mode 100644 index 0000000000000..ae5d8f9e0cce5 --- /dev/null +++ b/test/Parser/cxx-template-decl.cpp @@ -0,0 +1,82 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +// Errors +export class foo { }; // expected-error {{expected template}} +template x; // expected-error {{C++ requires a type specifier for all declarations}} +export template x; // expected-error {{expected '<' after 'template'}} \ + // expected-note {{exported templates are unsupported}} \ +// expected-error {{C++ requires a type specifier for all declarations}} +// 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