xref: /minix3/external/bsd/llvm/dist/clang/test/SemaTemplate/temp_arg.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc template<typename T,
3*f4a2713aSLionel Sambuc          int I,
4*f4a2713aSLionel Sambuc          template<typename> class TT>
5*f4a2713aSLionel Sambuc   class A; // expected-note 3 {{template is declared here}}
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc template<typename> class X;
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc A<int, 0, X> * a1;
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc A<float, 1, X, double> *a2; // expected-error{{too many template arguments for class template 'A'}}
12*f4a2713aSLionel Sambuc A<float, 1> *a3; // expected-error{{too few template arguments for class template 'A'}}
13*f4a2713aSLionel Sambuc A a3; // expected-error{{use of class template 'A' requires template arguments}}
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc namespace test0 {
16*f4a2713aSLionel Sambuc   template <class t> class foo {};
17*f4a2713aSLionel Sambuc   template <class t> class bar {
bar(::test0::foo<tee> * ptr)18*f4a2713aSLionel Sambuc     bar(::test0::foo<tee> *ptr) {} // FIXME(redundant): expected-error 2 {{use of undeclared identifier 'tee'}}
19*f4a2713aSLionel Sambuc   };
20*f4a2713aSLionel Sambuc }
21