Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x |
Anders Carlsson | 0ceffb5 | 2009-06-13 02:08:00 +0000 | [diff] [blame] | 2 | |
| 3 | // Type parameters packs |
| 4 | template <typename ...> struct TS1 {}; // expected-note{{template parameter is declared here}} |
| 5 | template struct TS1<>; |
| 6 | template struct TS1<int>; |
| 7 | template struct TS1<int, int>; |
| 8 | template struct TS1<int, 10>; // expected-error{{template argument for template type parameter must be a type}} |
| 9 | |
| 10 | template <typename, typename ...> struct TS2 {}; // expected-note{{template is declared here}} |
| 11 | template struct TS2<>; // expected-error{{too few template arguments for class template 'TS2'}} |
| 12 | template struct TS2<int>; |
| 13 | template struct TS2<int, int>; |
| 14 | |
| 15 | template <typename = int, typename ...> struct TS3 {}; // expected-note{{template parameter is declared here}} |
| 16 | template struct TS3<>; // expected-note{{previous explicit instantiation is here}} |
Douglas Gregor | 89a5bea | 2009-10-15 22:53:21 +0000 | [diff] [blame] | 17 | template struct TS3<int>; // expected-error{{duplicate explicit instantiation of 'TS3}} |
Anders Carlsson | 0ceffb5 | 2009-06-13 02:08:00 +0000 | [diff] [blame] | 18 | template struct TS3<int, int>; |
| 19 | template struct TS3<10>; // expected-error{{template argument for template type parameter must be a type}} |