Douglas Gregor | f03d7c7 | 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) { | ||||
13 | X x1 = y; // expected-error{{no matching constructor for initialization of 'x1'; candidates are:}} | ||||
14 | X x2 = 0; | ||||
15 | X x3 = ip; | ||||
16 | X x4 = fp; // expected-error{{incompatible type initializing 'x4', expected 'class X'}} | ||||
17 | } |