blob: f9bb44ecb9c0ca32086cbeb05938bac0422762b1 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Douglas Gregor62cb18d2009-02-11 18:16:40 +00002
3template<typename T, int N = 2> struct X; // expected-note{{template is declared here}}
4
5X<int, 1> *x1;
6X<int> *x2;
7
Douglas Gregor39a8de12009-02-25 19:37:18 +00008X<> *x3; // expected-error{{too few template arguments for class template 'X'}}
Douglas Gregor62cb18d2009-02-11 18:16:40 +00009
10template<typename U = float, int M> struct X;
11
12X<> *x4;
Anders Carlsson9bff9a92009-06-05 02:12:32 +000013
Anders Carlssonf4e2a2c2009-06-05 02:45:24 +000014template<typename T = int> struct Z { };
Anders Carlsson9bff9a92009-06-05 02:12:32 +000015template struct Z<>;
Anders Carlsson3b56c002009-06-11 16:06:49 +000016
17// PR4362
18template<class T> struct a { };
19template<> struct a<int> { static const bool v = true; };
20
21template<class T, bool = a<T>::v> struct p { }; // expected-error {{no member named 'v'}}
22
23template struct p<bool>; // expected-note {{in instantiation of default argument for 'p<bool>' required here}}
24template struct p<int>;