diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-13 02:08:00 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-13 02:08:00 +0000 |
commit | 0ceffb51b28b09db67404058c642dcb1f877f6e8 (patch) | |
tree | 5ca0ba92098e14baad1e4df08a62989d700cd51d /test/SemaTemplate/variadic-class-template-2.cpp | |
parent | f0ec39a99b543547609a36a1bca08836db7849a6 (diff) |
More work on type parameter packs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73281 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/variadic-class-template-2.cpp')
-rw-r--r-- | test/SemaTemplate/variadic-class-template-2.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaTemplate/variadic-class-template-2.cpp b/test/SemaTemplate/variadic-class-template-2.cpp new file mode 100644 index 0000000000..eadea901c7 --- /dev/null +++ b/test/SemaTemplate/variadic-class-template-2.cpp @@ -0,0 +1,19 @@ +// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x + +// Type parameters packs +template <typename ...> struct TS1 {}; // expected-note{{template parameter is declared here}} +template struct TS1<>; +template struct TS1<int>; +template struct TS1<int, int>; +template struct TS1<int, 10>; // expected-error{{template argument for template type parameter must be a type}} + +template <typename, typename ...> struct TS2 {}; // expected-note{{template is declared here}} +template struct TS2<>; // expected-error{{too few template arguments for class template 'TS2'}} +template struct TS2<int>; +template struct TS2<int, int>; + +template <typename = int, typename ...> struct TS3 {}; // expected-note{{template parameter is declared here}} +template struct TS3<>; // expected-note{{previous explicit instantiation is here}} +template struct TS3<int>; // expected-error{{duplicate explicit instantiation of 'TS3<>'}} +template struct TS3<int, int>; +template struct TS3<10>; // expected-error{{template argument for template type parameter must be a type}} |