Douglas Gregor | e704c9d | 2009-08-27 16:57:43 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | |
| 3 | template<typename T> |
| 4 | struct X0 { |
| 5 | template<typename U> T f0(U); |
| 6 | template<typename U> U& f1(T*, U); // expected-error{{pointer to a reference}} \ |
| 7 | // expected-note{{candidate}} |
| 8 | }; |
| 9 | |
| 10 | X0<int> x0i; |
| 11 | X0<void> x0v; |
| 12 | X0<int&> x0ir; // expected-note{{instantiation}} |
| 13 | |
| 14 | void test_X0(int *ip, double *dp) { |
| 15 | X0<int> xi; |
| 16 | int i1 = xi.f0(ip); |
| 17 | double *&dpr = xi.f1(ip, dp); |
| 18 | xi.f1(dp, dp); // expected-error{{no matching}} |
| 19 | |
| 20 | X0<void> xv; |
| 21 | double *&dpr2 = xv.f1(ip, dp); |
| 22 | } |