Douglas Gregor | 6428e76 | 2008-11-05 15:29:30 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | class X { |
| 4 | public: |
| 5 | explicit X(const X&); |
| 6 | X(int*); // expected-note{{candidate function}} |
| 7 | explicit X(float*); |
| 8 | }; |
| 9 | |
| 10 | class Y : public X { }; |
| 11 | |
| 12 | void f(Y y, int *ip, float *fp) { |
Sebastian Redl | fd9f2ac | 2008-11-22 13:44:36 +0000 | [diff] [blame] | 13 | X x1 = y; // expected-error{{no matching constructor for initialization of 'x1'; candidate is:}} |
Douglas Gregor | 6428e76 | 2008-11-05 15:29:30 +0000 | [diff] [blame] | 14 | X x2 = 0; |
| 15 | X x3 = ip; |
Douglas Gregor | 62ae25a | 2008-12-24 00:01:03 +0000 | [diff] [blame^] | 16 | X x4 = fp; // expected-error{{cannot initialize 'x4' with an lvalue of type 'float *'}} |
Douglas Gregor | 6428e76 | 2008-11-05 15:29:30 +0000 | [diff] [blame] | 17 | } |