diff options
author | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | 50b73317314e889cf39c7b1d6cbf419fa7502f22 (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/Parser/cxx-template-decl.cpp | |
parent | dc04cb328508e61aad809d9b53b12f9799a00e7d (diff) | |
download | FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.zip FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.tar.gz |
Vendor import of clang trunk r154661:
http://llvm.org/svn/llvm-project/cfe/trunk@r154661
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(); |