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; |
| 16 | X x4 = fp; // expected-error{{incompatible type initializing 'x4', expected 'class X'}} |
| 17 | } |