1 // RUN: clang-cc -fsyntax-only -verify %s
5 void f(T x); // expected-error{{argument may not have 'void' type}}
8 static int h(T, T); // expected-error 2{{argument may not have 'void' type}}
11 int identity(int x) { return x; }
13 void test(X<int> *xi, int *ip, X<int(int)> *xf) {
19 X<int(int)>::h(identity, &identity);
23 X<void> xv; // expected-note{{in instantiation of template class 'class X<void>' requested here}}
26 template<typename T, typename U>
29 int& f(T, T); // expected-note{{previous declaration is here}}
30 float& f(T, U); // expected-error{{functions that differ only in their return type cannot be overloaded}}
33 void test_ovl(Overloading<int, long> *oil, int i, long l) {
34 int &ir = oil->f(i, i);
35 float &fr = oil->f(i, l);
39 Overloading<float, float> off; // expected-note{{in instantiation of template class 'class Overloading<float, float>' requested here}}
45 virtual ~HasDestructor() = 0;
48 int i = sizeof(HasDestructor<int>); // FIXME: forces instantiation, but
49 // the code below should probably instantiate by itself.
50 int abstract_destructor[__is_abstract(HasDestructor<int>)? 1 : -1];
56 Constructors(const T&);
57 Constructors(const Constructors &other);
60 void test_constructors() {
61 Constructors<int> ci1(17);
62 Constructors<int> ci2 = ci1;
71 void test_converts_to(ConvertsTo<int> ci, ConvertsTo<int *> cip) {
77 template<class T> struct A0 { operator T*(); };
78 template<class T> struct A1;
80 int *a(A0<int> &x0, A1<int> &x1) {
82 int *y1 = x1; // expected-error{{initializing}}
95 int &f2() { return X0Base::f(); }
98 void test_X1(X1<int> x1i) {