default-arguments.cpp revision 3b56c002591b59c6c257951f6613b44de83fa860
1// RUN: clang-cc -fsyntax-only -verify %s 2 3template<typename T, int N = 2> struct X; // expected-note{{template is declared here}} 4 5X<int, 1> *x1; 6X<int> *x2; 7 8X<> *x3; // expected-error{{too few template arguments for class template 'X'}} 9 10template<typename U = float, int M> struct X; 11 12X<> *x4; 13 14template<typename T = int> struct Z { }; 15template struct Z<>; 16 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>; 25