Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Douglas Gregor | 83ddad3 | 2009-08-26 21:14:46 +0000 | [diff] [blame] | 2 | |
| 3 | struct X0 { // expected-note 4{{candidate}} |
| 4 | X0(int*, float*); // expected-note 4{{candidate}} |
| 5 | }; |
| 6 | |
| 7 | template<typename T, typename U> |
| 8 | X0 f0(T t, U u) { |
| 9 | X0 x0(t, u); // expected-error{{no matching}} |
| 10 | return X0(t, u); // expected-error{{no matching}} |
| 11 | } |
| 12 | |
| 13 | void test_f0(int *ip, float *fp, double *dp) { |
| 14 | f0(ip, fp); |
| 15 | f0(ip, dp); // expected-note{{instantiation}} |
| 16 | } |
| 17 | |
| 18 | template<typename Ret, typename T, typename U> |
| 19 | Ret f1(Ret *retty, T t, U u) { |
| 20 | Ret r0(t, u); // expected-error{{no matching}} |
| 21 | return Ret(t, u); // expected-error{{no matching}} |
| 22 | } |
| 23 | |
| 24 | void test_f1(X0 *x0, int *ip, float *fp, double *dp) { |
| 25 | f1(x0, ip, fp); |
| 26 | f1(x0, ip, dp); // expected-note{{instantiation}} |
| 27 | } |
| 28 | |
Douglas Gregor | 91be6f5 | 2010-03-02 17:18:33 +0000 | [diff] [blame] | 29 | namespace PR6457 { |
| 30 | template <typename T> struct X { explicit X(T* p = 0) { }; }; |
| 31 | template <typename T> struct Y { Y(int, const T& x); }; |
| 32 | struct A { }; |
| 33 | template <typename T> |
| 34 | struct B { |
| 35 | B() : y(0, X<A>()) { } |
| 36 | Y<X<A> > y; |
| 37 | }; |
| 38 | B<int> b; |
| 39 | } |
Douglas Gregor | 28329e5 | 2010-03-24 21:22:47 +0000 | [diff] [blame^] | 40 | |
| 41 | namespace PR6657 { |
| 42 | struct X |
| 43 | { |
| 44 | X (int, int) { } |
| 45 | }; |
| 46 | |
| 47 | template <typename> |
| 48 | void f0() |
| 49 | { |
| 50 | X x = X(0, 0); |
| 51 | } |
| 52 | |
| 53 | void f1() |
| 54 | { |
| 55 | f0<int>(); |
| 56 | } |
| 57 | } |