From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Parser/cxx-template-decl.cpp | 115 ++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 clang/test/Parser/cxx-template-decl.cpp (limited to 'clang/test/Parser/cxx-template-decl.cpp') diff --git a/clang/test/Parser/cxx-template-decl.cpp b/clang/test/Parser/cxx-template-decl.cpp new file mode 100644 index 0000000..7e931a3 --- /dev/null +++ b/clang/test/Parser/cxx-template-decl.cpp @@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// Errors +export class foo { }; // expected-error {{expected template}} +template x; // expected-error {{C++ requires a type specifier for all declarations}} \ + // 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 {{expected template parameter}} \ +// expected-error{{expected ',' or '>' in template-parameter-list}} \ +// expected-warning {{declaration does not declare anything}} +template 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 struct x2; // expected-error {{expected ',' or '>' in template-parameter-list}} \ + expected-error {{expected unqualified-id}} +template> struct x3; // expected-error {{expected ',' or '>' in template-parameter-list}} \ + expected-error {{template template parameter requires 'class' after the parameter list}} +template