Daniel Dunbar | ffd408a | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Douglas Gregor | c347d8e | 2009-02-11 18:16:40 +0000 | [diff] [blame] | 2 | |
| 3 | template<typename T, int N = 2> struct X; // expected-note{{template is declared here}} |
| 4 | |
| 5 | X<int, 1> *x1; |
| 6 | X<int> *x2; |
| 7 | |
Douglas Gregor | 0c281a8 | 2009-02-25 19:37:18 +0000 | [diff] [blame] | 8 | X<> *x3; // expected-error{{too few template arguments for class template 'X'}} |
Douglas Gregor | c347d8e | 2009-02-11 18:16:40 +0000 | [diff] [blame] | 9 | |
| 10 | template<typename U = float, int M> struct X; |
| 11 | |
| 12 | X<> *x4; |
Anders Carlsson | b912b39 | 2009-06-05 02:12:32 +0000 | [diff] [blame] | 13 | |
Anders Carlsson | efbff32 | 2009-06-05 02:45:24 +0000 | [diff] [blame] | 14 | template<typename T = int> struct Z { }; |
Anders Carlsson | b912b39 | 2009-06-05 02:12:32 +0000 | [diff] [blame] | 15 | template struct Z<>; |
Anders Carlsson | 0297caf | 2009-06-11 16:06:49 +0000 | [diff] [blame] | 16 | |
| 17 | // PR4362 |
| 18 | template<class T> struct a { }; |
| 19 | template<> struct a<int> { static const bool v = true; }; |
| 20 | |
| 21 | template<class T, bool = a<T>::v> struct p { }; // expected-error {{no member named 'v'}} |
| 22 | |
| 23 | template struct p<bool>; // expected-note {{in instantiation of default argument for 'p<bool>' required here}} |
| 24 | template struct p<int>; |